summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demuxer.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-28 14:43:19 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-28 14:43:19 +0000
commitbe54f4813fdc9f5714f3b010a46b962d37e27b2b (patch)
treeac769f2d59029f42db18c8a24a7175465a944e26 /libmpdemux/demuxer.c
parent68f4daf93b9921a1614fe9bfd349af20a3f5b63d (diff)
downloadmpv-be54f4813fdc9f5714f3b010a46b962d37e27b2b.tar.bz2
mpv-be54f4813fdc9f5714f3b010a46b962d37e27b2b.tar.xz
adds a parameter to the switch_audio command to directly select a track.
Patch by kiriuja mplayer-patches at en-directo net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15286 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demuxer.c')
-rw-r--r--libmpdemux/demuxer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index e2fbe222ab..3c675c6bef 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -1778,8 +1778,9 @@ int demuxer_get_percent_pos(demuxer_t *demuxer){
return ans;
}
-int demuxer_switch_audio(demuxer_t *demuxer){
- int ans = 0;
- int res = demux_control(demuxer, DEMUXER_CTRL_SWITCH_AUDIO, &ans);
- return ans;
+int demuxer_switch_audio(demuxer_t *demuxer, int index){
+ int res = demux_control(demuxer, DEMUXER_CTRL_SWITCH_AUDIO, &index);
+ if (res == DEMUXER_CTRL_NOTIMPL)
+ index = demuxer->audio->id;
+ return index;
}