From 804bf91570a24b949a6c68530daaf9162df9a234 Mon Sep 17 00:00:00 2001 From: mplayer-svn Date: Sun, 19 Feb 2012 13:15:41 +0000 Subject: 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. --- stream/cache2.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'stream/cache2.c') diff --git a/stream/cache2.c b/stream/cache2.c index b6bdd10b25..488e453dc6 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -88,6 +88,7 @@ typedef struct { volatile int control; volatile unsigned control_uint_arg; volatile double control_double_arg; + volatile struct stream_lang_req control_lang_arg; volatile int control_res; volatile double stream_time_length; volatile double stream_time_pos; @@ -310,6 +311,9 @@ static int cache_execute_control(cache_vars_t *s) { s->control_res = s->stream->control(s->stream, s->control, &uint_res); s->control_uint_arg = uint_res; break; + case STREAM_CTRL_GET_LANG: + s->control_res = s->stream->control(s->stream, s->control, (void *)&s->control_lang_arg); + break; default: s->control_res = STREAM_UNSUPPORTED; break; @@ -620,6 +624,8 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) { case STREAM_CTRL_GET_CURRENT_TIME: *(double *)arg = s->stream_time_pos; return s->stream_time_pos != MP_NOPTS_VALUE ? STREAM_OK : STREAM_UNSUPPORTED; + case STREAM_CTRL_GET_LANG: + s->control_lang_arg = *(struct stream_lang_req *)arg; case STREAM_CTRL_GET_NUM_CHAPTERS: case STREAM_CTRL_GET_CURRENT_CHAPTER: case STREAM_CTRL_GET_ASPECT_RATIO: @@ -665,6 +671,9 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) { case STREAM_CTRL_GET_ANGLE: *(unsigned *)arg = s->control_uint_arg; break; + case STREAM_CTRL_GET_LANG: + *(struct stream_lang_req *)arg = s->control_lang_arg; + break; } return s->control_res; } -- cgit v1.2.3