From: Joakim Plate <elu...@ecce.se>

It can take a long time before subtitles or data streams show up,
so we shouldn't wait for those before assuming we have all info
for streams.
---
This also is required for MS-RTSP streams not to stay waiting
in avformat_find_stream_info for a long time.

 libavformat/utils.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index c657f97..3244107 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2308,7 +2308,9 @@ int avformat_find_stream_info(AVFormatContext *ic, 
AVDictionary **options)
                 break;
             if(st->parser && st->parser->parser->split && 
!st->codec->extradata)
                 break;
-            if(st->first_dts == AV_NOPTS_VALUE)
+            if (st->first_dts == AV_NOPTS_VALUE &&
+                (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
+                 st->codec->codec_type == AVMEDIA_TYPE_AUDIO))
                 break;
         }
         if (i == ic->nb_streams) {
-- 
1.7.9.4

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to