changeset 5627:93c777b5ada3 libavformat

Try to open decoders in av_find_stream_info() even if no packets for the stream are found. Fixes issue1385
author michael
date Wed, 03 Feb 2010 23:05:58 +0000
parents b3d4ef7e53ad
children ee642c4e5b5c
files utils.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Wed Feb 03 09:58:14 2010 +0000
+++ b/utils.c	Wed Feb 03 23:05:58 2010 +0000
@@ -2089,6 +2089,13 @@
                 st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
             }
         }
+        assert(!st->codec->codec);
+        //try to just open decoders, in case this is enough to get parameters
+        if(!has_codec_parameters(st->codec)){
+            AVCodec *codec = avcodec_find_decoder(st->codec->codec_id);
+            if (codec)
+                avcodec_open(st->codec, codec);
+        }
     }
 
     for(i=0;i<MAX_STREAMS;i++){