diff options
author | cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-07 12:31:05 +0000 |
---|---|---|
committer | cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-07 12:31:05 +0000 |
commit | 423c415534f7393c07247b87ab4d95f6d0635474 (patch) | |
tree | dd986257786302c543d7a1807b4c310d15883276 /command.c | |
parent | 1698db0726e4b7c11f4dc47dfc823df5ab1cd80d (diff) | |
download | mpv-423c415534f7393c07247b87ab4d95f6d0635474.tar.bz2 mpv-423c415534f7393c07247b87ab4d95f6d0635474.tar.xz |
Separate teletext from tv support.
Path by Francesco Lavra, francescolavra interfree it
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29848 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 37 |
1 files changed, 18 insertions, 19 deletions
@@ -1889,8 +1889,7 @@ static int mp_property_teletext_common(m_option_t * prop, int action, void *arg, SET is GET+1 STEP is GET+2 */ - tvi_handle_t *tvh = mpctx->demuxer->priv; - if (mpctx->demuxer->type != DEMUXER_TYPE_TV || !tvh) + if (!mpctx->demuxer->teletext) return M_PROPERTY_UNAVAILABLE; if(!base_ioctl) return M_PROPERTY_ERROR; @@ -1899,31 +1898,30 @@ static int mp_property_teletext_common(m_option_t * prop, int action, void *arg, case M_PROPERTY_GET: if (!arg) return M_PROPERTY_ERROR; - result=tvh->functions->control(tvh->priv, base_ioctl, arg); + result=teletext_control(mpctx->demuxer->teletext, base_ioctl, arg); break; case M_PROPERTY_SET: if (!arg) return M_PROPERTY_ERROR; M_PROPERTY_CLAMP(prop, *(int *) arg); - result=tvh->functions->control(tvh->priv, base_ioctl+1, arg); + result=teletext_control(mpctx->demuxer->teletext, base_ioctl+1, arg); break; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - result=tvh->functions->control(tvh->priv, base_ioctl, &val); + result=teletext_control(mpctx->demuxer->teletext, base_ioctl, &val); val += (arg ? *(int *) arg : 1) * (action == M_PROPERTY_STEP_DOWN ? -1 : 1); - result=tvh->functions->control(tvh->priv, base_ioctl+1, &val); + result=teletext_control(mpctx->demuxer->teletext, base_ioctl+1, &val); break; default: return M_PROPERTY_NOT_IMPLEMENTED; } - return result == TVI_CONTROL_TRUE ? M_PROPERTY_OK : M_PROPERTY_ERROR; + return result == VBI_CONTROL_TRUE ? M_PROPERTY_OK : M_PROPERTY_ERROR; } static int mp_property_teletext_mode(m_option_t * prop, int action, void *arg, MPContext * mpctx) { - tvi_handle_t *tvh = mpctx->demuxer->priv; int result; int val; @@ -1932,7 +1930,8 @@ static int mp_property_teletext_mode(m_option_t * prop, int action, void *arg, if(result!=M_PROPERTY_OK) return result; - if(tvh->functions->control(tvh->priv, prop->priv, &val)==TVI_CONTROL_TRUE && val) + if(teletext_control(mpctx->demuxer->teletext, + (int)prop->priv, &val)==VBI_CONTROL_TRUE && val) mp_input_set_section("teletext"); else mp_input_set_section("tv"); @@ -1942,17 +1941,17 @@ static int mp_property_teletext_mode(m_option_t * prop, int action, void *arg, static int mp_property_teletext_page(m_option_t * prop, int action, void *arg, MPContext * mpctx) { - tvi_handle_t *tvh = mpctx->demuxer->priv; int result; int val; - if (mpctx->demuxer->type != DEMUXER_TYPE_TV || !tvh) + if (!mpctx->demuxer->teletext) return M_PROPERTY_UNAVAILABLE; switch(action){ case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: //This should be handled separately val = (arg ? *(int *) arg : 1) * (action == M_PROPERTY_STEP_DOWN ? -1 : 1); - result=tvh->functions->control(tvh->priv, TV_VBI_CONTROL_STEP_PAGE, &val); + result=teletext_control(mpctx->demuxer->teletext, + TV_VBI_CONTROL_STEP_PAGE, &val); break; default: result=mp_property_teletext_common(prop,action,arg,mpctx); @@ -2870,23 +2869,23 @@ 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; +#endif /* CONFIG_TV */ #ifdef CONFIG_TV_TELETEXT case MP_CMD_TV_TELETEXT_ADD_DEC: { - tvi_handle_t* tvh=(tvi_handle_t *)(mpctx->demuxer->priv); - if (mpctx->file_format == DEMUXER_TYPE_TV) - tvh->functions->control(tvh->priv,TV_VBI_CONTROL_ADD_DEC,&(cmd->args[0].v.s)); + if (mpctx->demuxer->teletext) + teletext_control(mpctx->demuxer->teletext,TV_VBI_CONTROL_ADD_DEC, + &(cmd->args[0].v.s)); break; } case MP_CMD_TV_TELETEXT_GO_LINK: { - tvi_handle_t* tvh=(tvi_handle_t *)(mpctx->demuxer->priv); - if (mpctx->file_format == DEMUXER_TYPE_TV) - tvh->functions->control(tvh->priv,TV_VBI_CONTROL_GO_LINK,&(cmd->args[0].v.i)); + if (mpctx->demuxer->teletext) + teletext_control(mpctx->demuxer->teletext,TV_VBI_CONTROL_GO_LINK, + &(cmd->args[0].v.i)); break; } #endif /* CONFIG_TV_TELETEXT */ -#endif /* CONFIG_TV */ case MP_CMD_SUB_LOAD: if (sh_video) { |