summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvd.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stream_dvd.c')
-rw-r--r--stream/stream_dvd.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index b9ffafed8f..e3e1595619 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -24,6 +24,7 @@
#include <string.h>
#include "config.h"
+#include "talloc.h"
#include "mp_msg.h"
#include <libgen.h>
@@ -112,7 +113,7 @@ int dvd_chapter_from_cell(dvd_priv_t* dvd,int title,int cell)
return chapter;
}
-int dvd_lang_from_aid(stream_t *stream, int id) {
+static int dvd_lang_from_aid(stream_t *stream, int id) {
dvd_priv_t *d;
int i;
if (!stream) return 0;
@@ -155,7 +156,7 @@ int dvd_number_of_subs(stream_t *stream) {
return maxid + 1;
}
-int dvd_lang_from_sid(stream_t *stream, int id) {
+static int dvd_lang_from_sid(stream_t *stream, int id) {
int i;
dvd_priv_t *d;
if (!stream) return 0;
@@ -687,6 +688,23 @@ static int control(stream_t *stream,int cmd,void* arg)
d->angle_seek = 1;
return 1;
}
+ case STREAM_CTRL_GET_LANG:
+ {
+ struct stream_lang_req *req = arg;
+ int lang = 0;
+ switch(req->type) {
+ case stream_ctrl_audio:
+ lang = dvd_lang_from_aid(stream, req->id);
+ break;
+ case stream_ctrl_sub:
+ lang = dvd_lang_from_sid(stream, req->id);
+ break;
+ }
+ if (!lang)
+ break;
+ req->name = talloc_strdup(NULL, (char[]) {lang >> 8, lang, 0});
+ return STREAM_OK;
+ }
}
return STREAM_UNSUPPORTED;
}