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_bluray.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_bluray.c')
-rw-r--r-- | stream/stream_bluray.c | 30 |
1 files changed, 30 insertions, 0 deletions
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; } |