[FFmpeg-devel,V2,1/4] lavf/utils: Respect default disposition when select the AVStream

Submitted by Jun Zhao on June 28, 2019, 7:21 a.m.

Details

Message ID 1561706472-15018-2-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao June 28, 2019, 7:21 a.m.
From: Jun Zhao <barryjzhao@tencent.com>

Respect default disposition when select the AVStream

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 libavformat/utils.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3d764c1..886cd6f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4218,7 +4218,8 @@  int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
                 continue;
             }
         }
-        disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | AV_DISPOSITION_VISUAL_IMPAIRED));
+        disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | AV_DISPOSITION_VISUAL_IMPAIRED))
+                      + !! (st->disposition & AV_DISPOSITION_DEFAULT);
         count = st->codec_info_nb_frames;
         bitrate = par->bit_rate;
         multiframe = FFMIN(5, count);