X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fh264_parser.c;h=443287176307cd6ebf052885523a35d1166a2959;hb=9026c49c82dce0a7658e7cd116f98fdd020d2bed;hp=3784e22de71d180419362ca9a7722d2716966b57;hpb=efe4a06929a885c740a255c42a746758cd60e97f;p=ffmpeg diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 3784e22de71..44328717630 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -76,13 +76,15 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf, else state >>= 1; // 2->1, 1->0, 0->0 } else if (state <= 5) { - int v = buf[i] & 0x1F; - if (v == 6 || v == 7 || v == 8 || v == 9) { + int nalu_type = buf[i] & 0x1F; + if (nalu_type == NAL_SEI || nalu_type == NAL_SPS || + nalu_type == NAL_PPS || nalu_type == NAL_AUD) { if (pc->frame_start_found) { i++; goto found; } - } else if (v == 1 || v == 2 || v == 5) { + } else if (nalu_type == NAL_SLICE || nalu_type == NAL_DPA || + nalu_type == NAL_IDR_SLICE) { state += 8; continue; }