From c7256fa6f97e8a684ebfee9617dabd12d595a90a Mon Sep 17 00:00:00 2001 From: nicodvb Date: Sat, 18 Nov 2006 12:34:06 +0000 Subject: implemented M_PROPERTY_SET in mp_property_{audio,video} git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21016 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'mplayer.c') 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)); -- cgit v1.2.3