aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-01-23 14:07:11 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-01-23 14:07:11 +0000
commita8062103ddcba7d865e7f572d561fc9ffb2dd113 (patch)
treeff7ed59ee50665c4dac50471a99b185e3ef6bfa8 /ffplay.c
parent2f29af3952b63b46fd337e85bc0d3307a2f6caff (diff)
downloadffmpeg-a8062103ddcba7d865e7f572d561fc9ffb2dd113.tar.gz
command line option to select the audio stream
Originally committed as revision 7665 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 3ffc520c5d..af1de41336 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -188,6 +188,7 @@ static int screen_width = 0;
static int screen_height = 0;
static int audio_disable;
static int video_disable;
+static int wanted_audio_stream= 0;
static int seek_by_bytes;
static int display_disable;
static int show_status;
@@ -1905,7 +1906,7 @@ static int decode_thread(void *arg)
AVCodecContext *enc = ic->streams[i]->codec;
switch(enc->codec_type) {
case CODEC_TYPE_AUDIO:
- if (audio_index < 0 && !audio_disable)
+ if ((audio_index < 0 || wanted_audio_stream-- > 0) && !audio_disable)
audio_index = i;
break;
case CODEC_TYPE_VIDEO:
@@ -2380,6 +2381,7 @@ const OptionDef options[] = {
{ "fs", OPT_BOOL, {(void*)&is_full_screen}, "force full screen" },
{ "an", OPT_BOOL, {(void*)&audio_disable}, "disable audio" },
{ "vn", OPT_BOOL, {(void*)&video_disable}, "disable video" },
+ { "ast", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_audio_stream}, "", "" },
{ "ss", HAS_ARG, {(void*)&opt_seek}, "seek to a given position in seconds", "pos" },
{ "bytes", OPT_BOOL, {(void*)&seek_by_bytes}, "seek by bytes" },
{ "nodisp", OPT_BOOL, {(void*)&display_disable}, "disable graphical display" },