mirror of
https://github.com/mpv-player/mpv
synced 2024-12-29 18:42:09 +00:00
stream: add STREAM_CTRL_GET_CURRENT_TITLE
Add new stream control command STREAM_CTRL_GET_CURRENT_TITLE for DVDs. This provides the current title (aka track) number of a DVD. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35263 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
d509a7867b
commit
1215f0871c
@ -307,6 +307,7 @@ static int cache_execute_control(cache_vars_t *s) {
|
||||
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:
|
||||
@ -634,6 +635,7 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) {
|
||||
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:
|
||||
@ -674,6 +676,7 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) {
|
||||
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:
|
||||
|
@ -95,6 +95,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
|
||||
|
||||
struct stream_lang_req {
|
||||
int type; // STREAM_AUDIO, STREAM_SUB
|
||||
|
@ -127,6 +127,11 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg)
|
||||
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;
|
||||
|
@ -643,6 +643,11 @@ static int control(stream_t *stream,int cmd,void* arg)
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user