# HG changeset patch # User ib # Date 1350831410 0 # Node ID 3b2c280da1afdcaeba89d482fe134c996597f756 # Parent 627bdd8915caeb726cd817d154b892656264c4c2 Add new stream control command STREAM_CTRL_GET_CURRENT_TITLE for DVDs. This provides the current title (aka track) number of a DVD. diff -r 627bdd8915ca -r 3b2c280da1af stream/cache2.c --- 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: diff -r 627bdd8915ca -r 3b2c280da1af stream/stream.h --- 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, diff -r 627bdd8915ca -r 3b2c280da1af stream/stream_bluray.c --- 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; diff -r 627bdd8915ca -r 3b2c280da1af stream/stream_dvd.c --- 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);