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/stream_bluray.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'stream/stream_bluray.c') diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c index 7563a9eb77..7c4f970159 100644 --- a/stream/stream_bluray.c +++ b/stream/stream_bluray.c @@ -34,6 +34,7 @@ #include "config.h" #include "libavutil/common.h" #include "libmpdemux/demuxer.h" +#include "talloc.h" #include "mp_msg.h" #include "m_struct.h" #include "m_option.h" @@ -191,6 +192,35 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg) return 1; } + case STREAM_CTRL_GET_LANG: { + struct stream_lang_req *req = arg; + BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, b->current_title, b->current_angle); + if (ti->clip_count) { + BLURAY_STREAM_INFO *si = NULL; + int count = 0; + switch (req->type) { + case stream_ctrl_audio: + count = ti->clips[0].audio_stream_count; + si = ti->clips[0].audio_streams; + break; + case stream_ctrl_sub: + count = ti->clips[0].pg_stream_count; + si = ti->clips[0].pg_streams; + break; + } + while (count-- > 0) { + if (si->pid == req->id) { + req->name = talloc_strndup(NULL, si->lang, 4); + bd_free_title_info(ti); + return STREAM_OK; + } + si++; + } + } + bd_free_title_info(ti); + return STREAM_ERROR; + } + default: break; } -- cgit v1.2.3