X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fh264_parser.c;h=e8243a23f66afeeacf5615f30ccd6e9f84b11c87;hb=0b25261d29c6b348e2dccc2985090cf10a60c34f;hp=ea0ab98034e7563554d8f305123761568ee7064e;hpb=d0cb6caf691ccd52fae1b3000691108cfacd327c;p=ffmpeg diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index ea0ab98034e..e8243a23f66 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -92,14 +92,13 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf, state = 7; } else { h->parse_history[h->parse_history_count++]= buf[i]; - if (h->parse_history_count>3) { + if (h->parse_history_count>5) { unsigned int mb, last_mb= h->parse_last_mb; GetBitContext gb; init_get_bits(&gb, h->parse_history, 8*h->parse_history_count); h->parse_history_count=0; mb= get_ue_golomb_long(&gb); - last_mb= h->parse_last_mb; h->parse_last_mb= mb; if (pc->frame_start_found) { if (mb <= last_mb) @@ -120,7 +119,7 @@ found: pc->frame_start_found = 0; if (h->is_avc) return next_avc; - return i - (state & 5) - 3 * (state > 7); + return i - (state & 5) - 5 * (state > 7); } static int scan_mmco_reset(AVCodecParserContext *s)