From 02135001b44afc5446228228055c9ce7f29df5be Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 3 Aug 2008 15:21:40 +0000 Subject: Change a bunch of video/audio-output-specific preprocessor directives from a HAVE_ prefix to a CONFIG_ prefix. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27402 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index e7182d3709..b18080b6a4 100644 --- a/command.c +++ b/command.c @@ -34,10 +34,10 @@ #ifdef CONFIG_RADIO #include "stream/stream_radio.h" #endif -#ifdef HAVE_PVR +#ifdef CONFIG_PVR #include "stream/pvr.h" #endif -#ifdef HAS_DVBIN_SUPPORT +#ifdef CONFIG_DVBIN #include "stream/dvbin.h" #endif #ifdef CONFIG_DVDREAD @@ -1860,7 +1860,7 @@ static int mp_property_tv_color(m_option_t * prop, int action, void *arg, #endif -#ifdef HAVE_TV_TELETEXT +#ifdef CONFIG_TV_TELETEXT static int mp_property_teletext_common(m_option_t * prop, int action, void *arg, MPContext * mpctx) { @@ -1941,7 +1941,7 @@ static int mp_property_teletext_page(m_option_t * prop, int action, void *arg, } -#endif /* HAVE_TV_TELETEXT */ +#endif /* CONFIG_TV_TELETEXT */ ///@} @@ -2092,7 +2092,7 @@ static const m_option_t mp_properties[] = { M_OPT_RANGE, -100, 100, (void *) TV_COLOR_HUE }, #endif -#ifdef HAVE_TV_TELETEXT +#ifdef CONFIG_TV_TELETEXT { "teletext_page", mp_property_teletext_page, CONF_TYPE_INT, M_OPT_RANGE, 100, 899, (void*)TV_VBI_CONTROL_GET_PAGE }, { "teletext_subpage", mp_property_teletext_common, CONF_TYPE_INT, @@ -2704,28 +2704,28 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) if (mpctx->file_format == DEMUXER_TYPE_TV) tv_set_freq((tvi_handle_t *) (mpctx->demuxer->priv), cmd->args[0].v.f * 16.0); -#ifdef HAVE_PVR +#ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_freq (mpctx->stream, ROUND (cmd->args[0].v.f)); set_osd_msg (OSD_MSG_TV_CHANNEL, 1, osd_duration, "%s: %s", pvr_get_current_channelname (mpctx->stream), pvr_get_current_stationname (mpctx->stream)); } -#endif /* HAVE_PVR */ +#endif /* CONFIG_PVR */ break; case MP_CMD_TV_STEP_FREQ: if (mpctx->file_format == DEMUXER_TYPE_TV) tv_step_freq((tvi_handle_t *) (mpctx->demuxer->priv), cmd->args[0].v.f * 16.0); -#ifdef HAVE_PVR +#ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_force_freq_step (mpctx->stream, ROUND (cmd->args[0].v.f)); set_osd_msg (OSD_MSG_TV_CHANNEL, 1, osd_duration, "%s: f %d", pvr_get_current_channelname (mpctx->stream), pvr_get_current_frequency (mpctx->stream)); } -#endif /* HAVE_PVR */ +#endif /* CONFIG_PVR */ break; case MP_CMD_TV_SET_NORM: @@ -2752,7 +2752,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) //vo_osd_changed(OSDTYPE_SUBTITLE); } } -#ifdef HAVE_PVR +#ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_channel_step (mpctx->stream, cmd->args[0].v.i); @@ -2760,9 +2760,9 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) pvr_get_current_channelname (mpctx->stream), pvr_get_current_stationname (mpctx->stream)); } -#endif /* HAVE_PVR */ +#endif /* CONFIG_PVR */ } -#ifdef HAS_DVBIN_SUPPORT +#ifdef CONFIG_DVBIN if (mpctx->stream->type == STREAMTYPE_DVB) { int dir; int v = cmd->args[0].v.i; @@ -2777,7 +2777,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) if (dvb_step_channel(mpctx->stream, dir)) mpctx->eof = mpctx->dvbin_reopen = 1; } -#endif /* HAS_DVBIN_SUPPORT */ +#endif /* CONFIG_DVBIN */ break; case MP_CMD_TV_SET_CHANNEL: @@ -2790,17 +2790,17 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) //vo_osd_changed(OSDTYPE_SUBTITLE); } } -#ifdef HAVE_PVR +#ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_channel (mpctx->stream, cmd->args[0].v.s); set_osd_msg (OSD_MSG_TV_CHANNEL, 1, osd_duration, "%s: %s", pvr_get_current_channelname (mpctx->stream), pvr_get_current_stationname (mpctx->stream)); } -#endif /* HAVE_PVR */ +#endif /* CONFIG_PVR */ break; -#ifdef HAS_DVBIN_SUPPORT +#ifdef CONFIG_DVBIN case MP_CMD_DVB_SET_CHANNEL: if (mpctx->stream->type == STREAMTYPE_DVB) { mpctx->last_dvb_step = 1; @@ -2810,7 +2810,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) mpctx->eof = mpctx->dvbin_reopen = 1; } break; -#endif /* HAS_DVBIN_SUPPORT */ +#endif /* CONFIG_DVBIN */ case MP_CMD_TV_LAST_CHANNEL: if (mpctx->file_format == DEMUXER_TYPE_TV) { @@ -2821,14 +2821,14 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) //vo_osd_changed(OSDTYPE_SUBTITLE); } } -#ifdef HAVE_PVR +#ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_lastchannel (mpctx->stream); set_osd_msg (OSD_MSG_TV_CHANNEL, 1, osd_duration, "%s: %s", pvr_get_current_channelname (mpctx->stream), pvr_get_current_stationname (mpctx->stream)); } -#endif /* HAVE_PVR */ +#endif /* CONFIG_PVR */ break; case MP_CMD_TV_STEP_NORM: @@ -2840,7 +2840,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) if (mpctx->file_format == DEMUXER_TYPE_TV) tv_step_chanlist((tvi_handle_t *) (mpctx->demuxer->priv)); break; -#ifdef HAVE_TV_TELETEXT +#ifdef CONFIG_TV_TELETEXT case MP_CMD_TV_TELETEXT_ADD_DEC: { tvi_handle_t* tvh=(tvi_handle_t *)(mpctx->demuxer->priv); @@ -2855,7 +2855,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) tvh->functions->control(tvh->priv,TV_VBI_CONTROL_GO_LINK,&(cmd->args[0].v.i)); break; } -#endif /* HAVE_TV_TELETEXT */ +#endif /* CONFIG_TV_TELETEXT */ #endif /* CONFIG_TV */ case MP_CMD_SUB_LOAD: -- cgit v1.2.3 From 291a150e81e631ae091b496b5c3a6771e9c6c28a Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 4 Aug 2008 13:25:20 +0000 Subject: Fixes unsafe 'switch_audio' command with set_property() call. Without it, MPlayer segv trying to dereference NULL demuxer. Patch by Mathieu Schroeter (mathieu dot schroeter at gamesover dot ch) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27411 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'command.c') diff --git a/command.c b/command.c index b18080b6a4..1f9bf1e4f5 100644 --- a/command.c +++ b/command.c @@ -835,6 +835,8 @@ static int mp_property_audio(m_option_t * prop, int action, void *arg, case M_PROPERTY_STEP_UP: case M_PROPERTY_SET: + if (!mpctx->demuxer) + return M_PROPERTY_UNAVAILABLE; if (action == M_PROPERTY_SET && arg) tmp = *((int *) arg); else -- cgit v1.2.3 From 149cab0b0454462040f9f8aa57eb0ec85f3e16d6 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 4 Aug 2008 13:33:22 +0000 Subject: Fixes unsafe 'angle' command with get_property() call. Without it, MPlayer segv trying to dereference NULL demuxer. Patch by Mathieu Schroeter (mathieu dot schroeter at gamesover dot ch) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27412 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'command.c') diff --git a/command.c b/command.c index 1f9bf1e4f5..2dedd97d14 100644 --- a/command.c +++ b/command.c @@ -450,10 +450,11 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg, static int mp_property_angle(m_option_t *prop, int action, void *arg, MPContext *mpctx) { - int angle; + int angle = -1; int angles; char *angle_name = NULL; + if (mpctx->demuxer) angle = demuxer_get_current_angle(mpctx->demuxer); if (angle < 0) return M_PROPERTY_UNAVAILABLE; -- cgit v1.2.3 From 8f484452164c8efc532dc36f9d6f548cd5234045 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 4 Aug 2008 13:34:10 +0000 Subject: cosmetic: reindent after r27412 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27413 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'command.c') diff --git a/command.c b/command.c index 2dedd97d14..31201b6fef 100644 --- a/command.c +++ b/command.c @@ -455,7 +455,7 @@ static int mp_property_angle(m_option_t *prop, int action, void *arg, char *angle_name = NULL; if (mpctx->demuxer) - angle = demuxer_get_current_angle(mpctx->demuxer); + angle = demuxer_get_current_angle(mpctx->demuxer); if (angle < 0) return M_PROPERTY_UNAVAILABLE; angles = demuxer_angles_count(mpctx->demuxer); -- cgit v1.2.3 From 450935badc256cc6c2307fd47cdb9c75fa294798 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 4 Aug 2008 13:35:14 +0000 Subject: Fixes unsafe 'chapter' command with get_property() call. Without it, MPlayer segv trying to dereference NULL demuxer. Patch by Mathieu Schroeter (mathieu dot schroeter at gamesover dot ch) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27414 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'command.c') diff --git a/command.c b/command.c index 31201b6fef..9b5fa9af40 100644 --- a/command.c +++ b/command.c @@ -379,12 +379,13 @@ static int mp_property_time_pos(m_option_t * prop, int action, static int mp_property_chapter(m_option_t *prop, int action, void *arg, MPContext *mpctx) { - int chapter; + int chapter = -1; float next_pts = 0; int chapter_num; int step_all; char *chapter_name = NULL; + if (mpctx->demuxer) chapter = demuxer_get_current_chapter(mpctx->demuxer); if (chapter < 0) return M_PROPERTY_UNAVAILABLE; -- cgit v1.2.3 From 5c1de42c0ce0bd2e0f55461d3e4a6f7a7ef2a3f8 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 4 Aug 2008 13:35:42 +0000 Subject: cosmetic: reindent after r27414 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27415 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'command.c') diff --git a/command.c b/command.c index 9b5fa9af40..2870a10faa 100644 --- a/command.c +++ b/command.c @@ -386,7 +386,7 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg, char *chapter_name = NULL; if (mpctx->demuxer) - chapter = demuxer_get_current_chapter(mpctx->demuxer); + chapter = demuxer_get_current_chapter(mpctx->demuxer); if (chapter < 0) return M_PROPERTY_UNAVAILABLE; -- cgit v1.2.3 From dba246199c20857d29a08bf176003b58736da31c Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 7 Aug 2008 09:53:59 +0000 Subject: Fix wrong behavior with slave command by going back to the starting point of the play_tree to pop all existing configurations. Patch by Mathieu Schroeter . git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27424 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'command.c') diff --git a/command.c b/command.c index 2870a10faa..1d6c89cd29 100644 --- a/command.c +++ b/command.c @@ -2655,6 +2655,10 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) break; case MP_CMD_STOP: + // Go back to the starting point. + while (play_tree_iter_up_step + (mpctx->playtree_iter, 0, 1) != PLAY_TREE_ITER_END) + /* NOP */ ; mpctx->eof = PT_STOP; brk_cmd = 1; break; -- cgit v1.2.3 From 091d352d065442817aa05c2f61910366004405be Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 7 Aug 2008 10:36:07 +0000 Subject: Rename font-related preprocessor directives. Switch them from a HAVE_ to a CONFIG_ prefix. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27425 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index 1d6c89cd29..116317432b 100644 --- a/command.c +++ b/command.c @@ -1776,7 +1776,7 @@ static int mp_property_sub_forced_only(m_option_t * prop, int action, } -#ifdef HAVE_FREETYPE +#ifdef CONFIG_FREETYPE /// Subtitle scale (RW) static int mp_property_sub_scale(m_option_t * prop, int action, void *arg, MPContext * mpctx) @@ -2076,7 +2076,7 @@ static const m_option_t mp_properties[] = { M_OPT_RANGE, 0, 1, NULL }, { "sub_forced_only", mp_property_sub_forced_only, CONF_TYPE_FLAG, M_OPT_RANGE, 0, 1, NULL }, -#ifdef HAVE_FREETYPE +#ifdef CONFIG_FREETYPE { "sub_scale", mp_property_sub_scale, CONF_TYPE_FLOAT, M_OPT_RANGE, 0, 100, NULL }, #endif @@ -2209,7 +2209,7 @@ static struct { { "sub_delay", MP_CMD_SUB_DELAY, 0, 0, OSD_MSG_SUB_DELAY, MSGTR_SubDelayStatus }, { "sub_visibility", MP_CMD_SUB_VISIBILITY, 1, 0, -1, MSGTR_SubVisibleStatus }, { "sub_forced_only", MP_CMD_SUB_FORCED_ONLY, 1, 0, -1, MSGTR_SubForcedOnlyStatus }, -#ifdef HAVE_FREETYPE +#ifdef CONFIG_FREETYPE { "sub_scale", MP_CMD_SUB_SCALE, 0, 0, -1, MSGTR_SubScale}, #endif #ifdef CONFIG_ASS -- cgit v1.2.3