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>
Sat, 11 Apr 2015 20:01:46 +0000 (22:01 +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 17ae300..1467f31 100644 (file)
@@ -1597,6 +1597,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;