changeset 2547:c5781912ad8a libavcodec

improved detection of "AVC1" style H.264 patch by (Mns Rullgrd <mru inprovide com>)
author michael
date Sun, 06 Mar 2005 19:40:12 +0000
parents 621cc4a94695
children bca31bc0cbae
files h264.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Sun Mar 06 14:48:50 2005 +0000
+++ b/h264.c	Sun Mar 06 19:40:12 2005 +0000
@@ -2632,15 +2632,13 @@
 
     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;