mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 06:03:45 +01:00
Add new command to switch between dvdnav titles
Based on parts of dvdnav monster patches from Otvos Attila git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25845 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
9b72cde125
commit
e28bd7c6de
@ -3134,6 +3134,12 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
|
||||
"Selected button number %d", button);
|
||||
}
|
||||
break;
|
||||
|
||||
case MP_CMD_SWITCH_TITLE:
|
||||
if (mpctx->stream->type == STREAMTYPE_DVDNAV)
|
||||
mp_dvdnav_switch_title(mpctx->stream, cmd->args[0].v.i);
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
default:
|
||||
|
@ -120,6 +120,7 @@ static const mp_cmd_t mp_cmds[] = {
|
||||
{ MP_CMD_GET_META_GENRE, "get_meta_genre", 0, { {-1,{0}} } },
|
||||
{ MP_CMD_SWITCH_AUDIO, "switch_audio", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } },
|
||||
{ MP_CMD_SWITCH_ANGLE, "switch_angle", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } },
|
||||
{ MP_CMD_SWITCH_TITLE, "switch_title", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } },
|
||||
#ifdef USE_TV
|
||||
{ MP_CMD_TV_START_SCAN, "tv_start_scan", 0, { {-1,{0}} }},
|
||||
{ MP_CMD_TV_STEP_CHANNEL, "tv_step_channel", 1, { { MP_CMD_ARG_INT ,{0}}, {-1,{0}} }},
|
||||
|
@ -108,6 +108,7 @@
|
||||
#define MP_CMD_SUB_DEMUX 104
|
||||
#define MP_CMD_SWITCH_ANGLE 105
|
||||
#define MP_CMD_ASS_USE_MARGINS 106
|
||||
#define MP_CMD_SWITCH_TITLE 107
|
||||
|
||||
#define MP_CMD_GUI_EVENTS 5000
|
||||
#define MP_CMD_GUI_LOADFILE 5001
|
||||
|
@ -759,6 +759,15 @@ void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl) {
|
||||
hl->ey = hlev.ey;
|
||||
}
|
||||
|
||||
void mp_dvdnav_switch_title (stream_t *stream, int title) {
|
||||
dvdnav_priv_t *priv = (dvdnav_priv_t *) stream->priv;
|
||||
uint32_t titles;
|
||||
|
||||
dvdnav_get_number_of_titles (priv->dvdnav, &titles);
|
||||
if (title > 0 && title <= titles)
|
||||
dvdnav_title_play (priv->dvdnav, title);
|
||||
}
|
||||
|
||||
const stream_info_t stream_info_dvdnav = {
|
||||
"DVDNAV stream",
|
||||
"null",
|
||||
|
@ -21,5 +21,6 @@ int mp_dvdnav_handle_input(stream_t *stream, int cmd, int *button);
|
||||
void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button);
|
||||
void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl);
|
||||
unsigned int *mp_dvdnav_get_spu_clut(stream_t *stream);
|
||||
void mp_dvdnav_switch_title(stream_t *stream, int title);
|
||||
|
||||
#endif /* MPLAYER_STREAM_DVDNAV_H */
|
||||
|
Loading…
Reference in New Issue
Block a user