From: Jun Zhao <barryjz...@tencent.com>

fix av_log use the uninitialized stream id

Signed-off-by: Jun Zhao <barryjz...@tencent.com>
---
 libavformat/mpegts.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 9092dbce72..722dae8e36 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2207,7 +2207,7 @@ static AVStream *find_matching_stream(MpegTSContext *ts, 
int pid, unsigned int p
                                       int stream_identifier, int 
pmt_stream_idx, struct Program *p)
 {
     AVFormatContext *s = ts->stream;
-    int i;
+    int i; // the stream id of the match
     AVStream *found = NULL;
 
     if (stream_identifier) { /* match based on "stream identifier descriptor" 
if present */
@@ -2218,6 +2218,7 @@ static AVStream *find_matching_stream(MpegTSContext *ts, 
int pid, unsigned int p
         }
     } else if (pmt_stream_idx < p->nb_streams) { /* match based on position 
within the PMT */
         found = s->streams[p->streams[pmt_stream_idx].idx];
+        i = pmt_stream_idx;
     }
 
     if (found) {
-- 
2.17.1

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to