You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
@@ -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) {
|
if (d[2] == 'p' && d[3] == 'c' && size <= 4 * 256 + 4) {
|
||||||
int k = avio_r8(pb);
|
int k = avio_r8(pb);
|
||||||
int last = (k + avio_r8(pb) - 1) & 0xFF;
|
int last = (k + avio_r8(pb) - 1) & 0xFF;
|
||||||
@@ -1304,6 +1291,18 @@ start_sync:
|
|||||||
ast->prefix_count = 0;
|
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;
|
avi->stream_index = n;
|
||||||
ast->packet_size = size + 8;
|
ast->packet_size = size + 8;
|
||||||
ast->remaining = size;
|
ast->remaining = size;
|
||||||
|
Reference in New Issue
Block a user