changeset 35169:3b2c280da1af

Add new stream control command STREAM_CTRL_GET_CURRENT_TITLE for DVDs. This provides the current title (aka track) number of a DVD.
author ib
date Sun, 21 Oct 2012 14:56:50 +0000
parents 627bdd8915ca
children 6f214e8ae780
files stream/cache2.c stream/stream.h stream/stream_bluray.c stream/stream_dvd.c
diffstat 4 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stream/cache2.c	Sun Oct 21 14:40:49 2012 +0000
+++ b/stream/cache2.c	Sun Oct 21 14:56:50 2012 +0000
@@ -312,6 +312,7 @@
       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 @@
       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 @@
       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:
--- a/stream/stream.h	Sun Oct 21 14:40:49 2012 +0000
+++ b/stream/stream.h	Sun Oct 21 14:56:50 2012 +0000
@@ -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,
--- a/stream/stream_bluray.c	Sun Oct 21 14:40:49 2012 +0000
+++ b/stream/stream_bluray.c	Sun Oct 21 14:56:50 2012 +0000
@@ -126,6 +126,11 @@
         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;
--- a/stream/stream_dvd.c	Sun Oct 21 14:40:49 2012 +0000
+++ b/stream/stream_dvd.c	Sun Oct 21 14:56:50 2012 +0000
@@ -687,6 +687,11 @@
 
             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);