changeset 1886:cf8db4fe9efa libavformat

workaround for broken flvtoolized files
author alex
date Wed, 07 Mar 2007 01:52:08 +0000
parents 3ffb9763dfc2
children 490aa34aef0f
files flvdec.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flvdec.c	Wed Mar 07 00:49:49 2007 +0000
+++ b/flvdec.c	Wed Mar 07 01:52:08 2007 +0000
@@ -230,6 +230,12 @@
 
     url_fskip(&s->pb, 4);
     flags = get_byte(&s->pb);
+    /* old flvtool cleared this field */
+    /* FIXME: better fix needed */
+    if (!flags) {
+        flags = FLV_HEADER_FLAG_HASVIDEO | FLV_HEADER_FLAG_HASAUDIO;
+        av_log(s, AV_LOG_WARNING, "Broken FLV file, which says no streams present, this might fail\n");
+    }
 
     if(flags & FLV_HEADER_FLAG_HASVIDEO){
         st = av_new_stream(s, 0);