# HG changeset patch # User reimar # Date 1329658756 0 # Node ID 6dcc91eb3cf8341b20e8bee1ad4dfb29235a553e # Parent 26eddbd6353a29d3b5545c3ceacedcefb35fba6e Support showing the stream language with br:// playback. diff -r 26eddbd6353a -r 6dcc91eb3cf8 stream/stream_bluray.c --- a/stream/stream_bluray.c Sun Feb 19 13:15:41 2012 +0000 +++ b/stream/stream_bluray.c Sun Feb 19 13:39:16 2012 +0000 @@ -191,6 +191,36 @@ 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) { + memcpy(req->buf, si->lang, 4); + req->buf[4] = 0; + bd_free_title_info(ti); + return STREAM_OK; + } + si++; + } + } + bd_free_title_info(ti); + return STREAM_ERROR; + } + default: break; }