[MPlayer-cvslog] r35263 - in trunk/stream: cache2.c stream.h stream_bluray.c stream_dvd.c

ib subversion at mplayerhq.hu
Sun Oct 21 16:56:51 CEST 2012


Author: ib
Date: Sun Oct 21 16:56:50 2012
New Revision: 35263

Log:
Add new stream control command STREAM_CTRL_GET_CURRENT_TITLE for DVDs.

This provides the current title (aka track) number of a DVD.

Modified:
   trunk/stream/cache2.c
   trunk/stream/stream.h
   trunk/stream/stream_bluray.c
   trunk/stream/stream_dvd.c

Modified: trunk/stream/cache2.c
==============================================================================
--- trunk/stream/cache2.c	Sun Oct 21 16:40:49 2012	(r35262)
+++ trunk/stream/cache2.c	Sun Oct 21 16:56:50 2012	(r35263)
@@ -312,6 +312,7 @@ static int cache_execute_control(cache_v
       uint_res = s->control_uint_arg;
     case STREAM_CTRL_GET_NUM_TITLES:
     case STREAM_CTRL_GET_NUM_CHAPTERS:
+    case STREAM_CTRL_GET_CURRENT_TITLE:
     case STREAM_CTRL_GET_CURRENT_CHAPTER:
     case STREAM_CTRL_GET_NUM_ANGLES:
     case STREAM_CTRL_GET_ANGLE:
@@ -643,6 +644,7 @@ int cache_do_control(stream_t *stream, i
       s->control_lang_arg = *(struct stream_lang_req *)arg;
     case STREAM_CTRL_GET_NUM_TITLES:
     case STREAM_CTRL_GET_NUM_CHAPTERS:
+    case STREAM_CTRL_GET_CURRENT_TITLE:
     case STREAM_CTRL_GET_CURRENT_CHAPTER:
     case STREAM_CTRL_GET_ASPECT_RATIO:
     case STREAM_CTRL_GET_NUM_ANGLES:
@@ -684,6 +686,7 @@ int cache_do_control(stream_t *stream, i
       break;
     case STREAM_CTRL_GET_NUM_TITLES:
     case STREAM_CTRL_GET_NUM_CHAPTERS:
+    case STREAM_CTRL_GET_CURRENT_TITLE:
     case STREAM_CTRL_GET_CURRENT_CHAPTER:
     case STREAM_CTRL_GET_NUM_ANGLES:
     case STREAM_CTRL_GET_ANGLE:

Modified: trunk/stream/stream.h
==============================================================================
--- trunk/stream/stream.h	Sun Oct 21 16:40:49 2012	(r35262)
+++ trunk/stream/stream.h	Sun Oct 21 16:56:50 2012	(r35263)
@@ -100,6 +100,7 @@
 #define STREAM_CTRL_SET_ANGLE 11
 #define STREAM_CTRL_GET_NUM_TITLES 12
 #define STREAM_CTRL_GET_LANG 13
+#define STREAM_CTRL_GET_CURRENT_TITLE 14
 
 enum stream_ctrl_type {
 	stream_ctrl_audio,

Modified: trunk/stream/stream_bluray.c
==============================================================================
--- trunk/stream/stream_bluray.c	Sun Oct 21 16:40:49 2012	(r35262)
+++ trunk/stream/stream_bluray.c	Sun Oct 21 16:56:50 2012	(r35263)
@@ -126,6 +126,11 @@ static int bluray_stream_control(stream_
         return 1;
     }
 
+    case STREAM_CTRL_GET_CURRENT_TITLE: {
+        *((unsigned int *) arg) = b->current_title;
+        return 1;
+    }
+
     case STREAM_CTRL_GET_CURRENT_CHAPTER: {
         *((unsigned int *) arg) = b->current_chapter;
         return 1;

Modified: trunk/stream/stream_dvd.c
==============================================================================
--- trunk/stream/stream_dvd.c	Sun Oct 21 16:40:49 2012	(r35262)
+++ trunk/stream/stream_dvd.c	Sun Oct 21 16:56:50 2012	(r35263)
@@ -687,6 +687,11 @@ static int control(stream_t *stream,int 
 
             return 1;
         }
+        case STREAM_CTRL_GET_CURRENT_TITLE:
+        {
+            *((unsigned int *)arg) = d->cur_title - 1;
+            return 1;
+        }
         case STREAM_CTRL_GET_CURRENT_CHAPTER:
         {
             *((unsigned int *)arg) = dvd_chapter_from_cell(d, d->cur_title-1, d->cur_cell);


More information about the MPlayer-cvslog mailing list