[FFmpeg-devel] [PATCH] Warn user if they try to encode into a container requiring global headers in extradata without codec set correctly

Art Clarke aclarke
Tue Feb 10 16:09:57 CET 2009


$subject

Thanks to Baptiste for the suggestion.

- Art

-- 
http://www.xuggle.com/
xu?ggle (z?' gl) v. To freely encode, decode, and experience audio and video.

Use Xuggle to get the power of FFMPEG in Java.
-------------- next part --------------
Index: libavformat/utils.c
===================================================================
--- libavformat/utils.c	(revision 17132)
+++ libavformat/utils.c	(working copy)
@@ -2446,6 +2446,10 @@
             }else
                 st->codec->codec_tag= av_codec_get_tag(s->oformat->codec_tag, st->codec->codec_id);
         }
+
+        if(s->oformat->flags & AVFMT_GLOBALHEADER && 
+            !(st->codec->flags & CODEC_FLAG_GLOBAL_HEADER))
+          av_log(s, AV_LOG_WARNING, "Codec for stream %d does not use global headers but container format requires global headers\n", i);
     }
 
     if (!s->priv_data && s->oformat->priv_data_size > 0) {



More information about the ffmpeg-devel mailing list