[FFmpeg-cvslog] avformat/mov: Skip non-key frames if AVDISCARD_NONKEY is set.

Vadim Kalinsky git at videolan.org
Thu Jun 30 15:37:50 CEST 2016


ffmpeg | branch: master | Vadim Kalinsky <vadim at kalinsky.ru> | Tue Jun 28 14:09:46 2016 -0400| [e370aad67ddb15033f656f6b1120c030c759f30b] | committer: Michael Niedermayer

avformat/mov: Skip non-key frames if AVDISCARD_NONKEY is set.

Github: Closes #222

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e370aad67ddb15033f656f6b1120c030c759f30b
---

 libavformat/mov.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index a929f74..485bb0b 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);



More information about the ffmpeg-cvslog mailing list