From a33cfa3071eb2a1a501223469c33252054a798ed Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sun, 13 Apr 2008 23:47:03 +0000
Subject: [PATCH] Stop find_stream_info() searching for further streams if 2
 streams have been found.

Originally committed as revision 12810 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/flvdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 34bc78d122a..1dd79f34788 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -324,6 +324,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
     if(i == s->nb_streams){
         av_log(NULL, AV_LOG_ERROR, "invalid stream\n");
         st= create_stream(s, is_audio);
+        s->ctx_flags &= ~AVFMTCTX_NOHEADER;
     }
 //    av_log(NULL, AV_LOG_DEBUG, "%d %X %d \n", is_audio, flags, st->discard);
     if(  (st->discard >= AVDISCARD_NONKEY && !((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY ||         is_audio))
-- 
GitLab