avformat/utils: avoid discarded streams in av_find_default_stream_index()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 6 Apr 2015 02:20:51 +0000 (04:20 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 17 Apr 2015 13:20:29 +0000 (15:20 +0200)
Fixes Ticket2010

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ff6841c6bb2d35f8d461419e45d59be7542d03fe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 78653d1..1ab8bb6 100644 (file)
@@ -1583,6 +1583,9 @@ int av_find_default_stream_index(AVFormatContext *s)
                 score += 50;
         }
 
+        if (st->discard != AVDISCARD_ALL)
+            score += 200;
+
         if (score > best_score) {
             best_score = score;
             best_stream = i;