diff options
author | Vadim Kalinsky <vadim@kalinsky.ru> | 2016-06-28 14:09:46 -0400 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-30 12:00:13 +0200 |
commit | e370aad67ddb15033f656f6b1120c030c759f30b (patch) | |
tree | 2434eb6e1c21d172e8f3c2a6de1a9e677ec40fe3 | |
parent | f48aea66ddfef3998ee7aaf6c6567577ae481807 (diff) | |
download | ffmpeg-e370aad67ddb15033f656f6b1120c030c759f30b.tar.gz |
avformat/mov: Skip non-key frames if AVDISCARD_NONKEY is set.
Github: Closes #222
-rw-r--r-- | libavformat/mov.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index a929f74511..485bb0bc0c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -5224,6 +5224,12 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) sc->current_sample -= should_retry(sc->pb, ret64); return AVERROR_INVALIDDATA; } + + if( st->discard == AVDISCARD_NONKEY && 0==(sample->flags & AVINDEX_KEYFRAME) ) { + av_log(mov->fc, AV_LOG_DEBUG, "Nonkey frame from stream %d discarded due to AVDISCARD_NONKEY\n", sc->ffindex); + goto retry; + } + ret = av_get_packet(sc->pb, pkt, sample->size); if (ret < 0) { sc->current_sample -= should_retry(sc->pb, ret); |