diff options
author | mplayer-svn <svn@mplayerhq.hu> | 2012-02-19 13:15:41 +0000 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-08-03 01:59:15 +0200 |
commit | 804bf91570a24b949a6c68530daaf9162df9a234 (patch) | |
tree | 479bb687f73be7d82f0a7ea43a7baa6b42cccb5f /stream/stream_dvd.c | |
parent | 14a67dd301bfd68712440a65b0acbafc2121910e (diff) | |
download | mpv-804bf91570a24b949a6c68530daaf9162df9a234.tar.bz2 mpv-804bf91570a24b949a6c68530daaf9162df9a234.tar.xz |
commands, dvd, dvdnav, bluray: cleanup sub/audio track language display
Code cleanup: Use a stream_control instead of global functions to
get the language associate with a audio or subtitle stream from
the streaming layer.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34736 b3059339-0415-0410-9bf9-f77b7e298cf2
Support showing the stream language with br:// playback.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34737 b3059339-0415-0410-9bf9-f77b7e298cf2
Fix DVDs showing the subtitle language as "unknown"
for a long time.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34777 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
Note: heavily modified by wm4 for this fork of mplayer.
Diffstat (limited to 'stream/stream_dvd.c')
-rw-r--r-- | stream/stream_dvd.c | 22 |
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; } |