diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-08 02:17:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-11 12:07:08 +0200 |
commit | 511e10f673a69c05744be0355cc9ce5705407bc2 (patch) | |
tree | d05624662d2b340e41495cee855125085012160c /libavformat/avidec.c | |
parent | 84786e928f9e54bdc3622f68db0ce35bae43fb46 (diff) | |
download | ffmpeg-511e10f673a69c05744be0355cc9ce5705407bc2.tar.gz |
avformat/avidec: Move packet skip after prefix and related checks
This fixes loosing packets
Fixes: big.avi
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r-- | libavformat/avidec.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index df52092067..9816a1dfac 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1265,19 +1265,6 @@ start_sync: } } - if (!avi->dv_demux && - ((st->discard >= AVDISCARD_DEFAULT && size == 0) /* || - // FIXME: needs a little reordering - (st->discard >= AVDISCARD_NONKEY && - !(pkt->flags & AV_PKT_FLAG_KEY)) */ - || st->discard >= AVDISCARD_ALL)) { - if (!exit_early) { - ast->frame_offset += get_duration(ast, size); - avio_skip(pb, size); - goto start_sync; - } - } - if (d[2] == 'p' && d[3] == 'c' && size <= 4 * 256 + 4) { int k = avio_r8(pb); int last = (k + avio_r8(pb) - 1) & 0xFF; @@ -1304,6 +1291,18 @@ start_sync: ast->prefix_count = 0; } + if (!avi->dv_demux && + ((st->discard >= AVDISCARD_DEFAULT && size == 0) /* || + // FIXME: needs a little reordering + (st->discard >= AVDISCARD_NONKEY && + !(pkt->flags & AV_PKT_FLAG_KEY)) */ + || st->discard >= AVDISCARD_ALL)) { + + ast->frame_offset += get_duration(ast, size); + avio_skip(pb, size); + goto start_sync; + } + avi->stream_index = n; ast->packet_size = size + 8; ast->remaining = size; |