[MPlayer-cvslog] r25845 - in trunk: command.c input/input.c input/input.h stream/stream_dvdnav.c stream/stream_dvdnav.h

ben subversion at mplayerhq.hu
Thu Jan 24 20:14:06 CET 2008


Author: ben
Date: Thu Jan 24 20:14:05 2008
New Revision: 25845

Log:
Add new command to switch between dvdnav titles
Based on parts of dvdnav monster patches from Otvos Attila



Modified:
   trunk/command.c
   trunk/input/input.c
   trunk/input/input.h
   trunk/stream/stream_dvdnav.c
   trunk/stream/stream_dvdnav.h

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	(original)
+++ trunk/command.c	Thu Jan 24 20:14:05 2008
@@ -3134,6 +3134,12 @@ int run_command(MPContext * mpctx, mp_cm
 				"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:

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	(original)
+++ trunk/input/input.c	Thu Jan 24 20:14:05 2008
@@ -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}} }},

Modified: trunk/input/input.h
==============================================================================
--- trunk/input/input.h	(original)
+++ trunk/input/input.h	Thu Jan 24 20:14:05 2008
@@ -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

Modified: trunk/stream/stream_dvdnav.c
==============================================================================
--- trunk/stream/stream_dvdnav.c	(original)
+++ trunk/stream/stream_dvdnav.c	Thu Jan 24 20:14:05 2008
@@ -759,6 +759,15 @@ void mp_dvdnav_get_highlight (stream_t *
   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",

Modified: trunk/stream/stream_dvdnav.h
==============================================================================
--- trunk/stream/stream_dvdnav.h	(original)
+++ trunk/stream/stream_dvdnav.h	Thu Jan 24 20:14:05 2008
@@ -21,5 +21,6 @@ int mp_dvdnav_handle_input(stream_t *str
 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 */



More information about the MPlayer-cvslog mailing list