From 481747c6f74c7e17fcefc9341533f90b6fc8cd5b Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Thu, 6 Oct 2011 21:59:50 +0200
Subject: [PATCH] ffmpeg: make -a/v/sn work with -map

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 ffmpeg.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 43d8b771c85..e9133ec6117 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3648,6 +3648,13 @@ static void opt_output_file(void *optctx, const char *filename)
                 continue;
 
             ist = &input_streams[input_files[map->file_index].ist_index + map->stream_index];
+            if(o->subtitle_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE)
+                continue;
+            if(o->   audio_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
+                continue;
+            if(o->   video_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
+                continue;
+
             switch (ist->st->codec->codec_type) {
             case AVMEDIA_TYPE_VIDEO:    ost = new_video_stream(o, oc);    break;
             case AVMEDIA_TYPE_AUDIO:    ost = new_audio_stream(o, oc);    break;
-- 
GitLab