summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-18 12:34:06 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-18 12:34:06 +0000
commitc7256fa6f97e8a684ebfee9617dabd12d595a90a (patch)
tree8dc8f83678971d5a5b44a4038fae5835ee75e095 /mplayer.c
parent9d80dcfa3d23378eb9b8c0c3f8b4894c96abf86a (diff)
downloadmpv-c7256fa6f97e8a684ebfee9617dabd12d595a90a.tar.bz2
mpv-c7256fa6f97e8a684ebfee9617dabd12d595a90a.tar.xz
implemented M_PROPERTY_SET in mp_property_{audio,video}
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21016 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/mplayer.c b/mplayer.c
index 3bbfa6d01b..d56bf8c36a 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -1795,7 +1795,7 @@ static int mp_property_channels(m_option_t* prop,int action,void* arg) {
/// Selected audio id (RW)
static int mp_property_audio(m_option_t* prop,int action,void* arg) {
- int current_id = -1;
+ int current_id = -1, tmp;
if(!sh_audio) return M_PROPERTY_UNAVAILABLE;
@@ -1829,8 +1829,13 @@ static int mp_property_audio(m_option_t* prop,int action,void* arg) {
return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
+ case M_PROPERTY_SET:
+ if(action==M_PROPERTY_SET && arg)
+ tmp = *((int*)arg);
+ else
+ tmp = -1;
current_id = demuxer->audio->id;
- audio_id = demuxer_switch_audio(demuxer, -1);
+ audio_id = demuxer_switch_audio(demuxer, tmp);
if(audio_id > -1 && demuxer->audio->id != current_id) {
sh_audio_t *sh2;
uninit_player(INITED_AO | INITED_ACODEC);
@@ -1852,7 +1857,7 @@ static int mp_property_audio(m_option_t* prop,int action,void* arg) {
static int reinit_video_chain(void);
/// Selected video id (RW)
static int mp_property_video(m_option_t* prop,int action,void* arg) {
- int current_id = -1;
+ int current_id = -1, tmp;
if(!sh_video) return M_PROPERTY_UNAVAILABLE;
@@ -1874,8 +1879,13 @@ static int mp_property_video(m_option_t* prop,int action,void* arg) {
return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
+ case M_PROPERTY_SET:
current_id = demuxer->video->id;
- video_id = demuxer_switch_video(demuxer, -1);
+ if(action==M_PROPERTY_SET && arg)
+ tmp = *((int*)arg);
+ else
+ tmp = -1;
+ video_id = demuxer_switch_video(demuxer, tmp);
if(video_id > -1 && demuxer->video->id != current_id) {
sh_video_t *sh2;
uninit_player(INITED_VCODEC | (fixed_vo ? 0 : INITED_VO));