1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

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

Github: Closes #222
This commit is contained in:
Vadim Kalinsky 2016-06-28 14:09:46 -04:00 committed by Michael Niedermayer
parent f48aea66dd
commit e370aad67d

View File

@ -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);