From 26165f99c673e3bb7b983192fabc79a110bdd3af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Sun, 6 Mar 2005 19:40:12 +0000 Subject: [PATCH] =?UTF-8?q?improved=20detection=20of=20"AVC1"=20style=20H.?= =?UTF-8?q?264=20patch=20by=20(M=C3=A5ns=20Rullg=C3=A5rd=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 4013 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a059449efc..ae994184a6 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2632,15 +2632,13 @@ static int decode_init(AVCodecContext *avctx){ decode_init_vlc(h); - if(avctx->codec_tag != 0x31637661 && avctx->codec_tag != 0x31435641) // avc1 - h->is_avc = 0; - else { - if((avctx->extradata_size == 0) || (avctx->extradata == NULL)) { - av_log(avctx, AV_LOG_ERROR, "AVC codec requires avcC data\n"); - return -1; - } + if(avctx->extradata_size > 0 && avctx->extradata && + *(char *)avctx->extradata == 1){ + av_log(avctx, AV_LOG_INFO, "assuming AVC1 format\n"); h->is_avc = 1; h->got_avcC = 0; + } else { + h->is_avc = 0; } return 0;