mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
mpeg4video: ignore broken GOP headers
Some MPEG4 cameras produce files with empty GOP headers. This patch makes the decoder ignore such broken headers and proceed with the following I-frame. Without this change, the following start code is missed resulting in the entire I-frame being skipped. Signed-off-by: Mans Rullgard <mans@mansr.com>
This commit is contained in:
parent
5d57846bba
commit
7a4abe5912
@ -1494,16 +1494,17 @@ end:
|
|||||||
|
|
||||||
static int mpeg4_decode_gop_header(MpegEncContext * s, GetBitContext *gb){
|
static int mpeg4_decode_gop_header(MpegEncContext * s, GetBitContext *gb){
|
||||||
int hours, minutes, seconds;
|
int hours, minutes, seconds;
|
||||||
|
unsigned time_code = show_bits(gb, 18);
|
||||||
|
|
||||||
hours= get_bits(gb, 5);
|
if (time_code & 0x40) { /* marker_bit */
|
||||||
minutes= get_bits(gb, 6);
|
hours = time_code >> 13;
|
||||||
skip_bits1(gb);
|
minutes = time_code >> 7 & 0x3f;
|
||||||
seconds= get_bits(gb, 6);
|
seconds = time_code & 0x3f;
|
||||||
|
s->time_base = seconds + 60*(minutes + 60*hours);
|
||||||
s->time_base= seconds + 60*(minutes + 60*hours);
|
skip_bits(gb, 20); /* time_code, closed_gov, broken_link */
|
||||||
|
} else {
|
||||||
skip_bits1(gb);
|
av_log(s->avctx, AV_LOG_WARNING, "GOP header missing marker_bit\n");
|
||||||
skip_bits1(gb);
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user