Commit 17f392f4 authored by hpi1's avatar hpi1

Automatic language selection: disable subtitles when audio is in the same language

parent 302efd30
- Automatic language selection: disable subtitles when audio is in the same language
- Fixed accessing outside of array bounds - Fixed accessing outside of array bounds
- Default to stream 0 when requested language not found - Default to stream 0 when requested language not found
- Install bd_info - Install bd_info
......
...@@ -259,7 +259,8 @@ static int _queue_event(BLURAY *bd, BD_EVENT ev) ...@@ -259,7 +259,8 @@ static int _queue_event(BLURAY *bd, BD_EVENT ev)
static void _update_stream_psr_by_lang(BD_REGISTERS *regs, static void _update_stream_psr_by_lang(BD_REGISTERS *regs,
uint32_t psr_lang, uint32_t psr_stream, uint32_t psr_lang, uint32_t psr_stream,
uint32_t enable_flag, uint32_t enable_flag,
MPLS_STREAM *streams, unsigned num_streams) MPLS_STREAM *streams, unsigned num_streams,
uint32_t *lang, uint32_t blacklist)
{ {
uint32_t psr_val; uint32_t psr_val;
int stream_idx = -1; int stream_idx = -1;
...@@ -285,6 +286,14 @@ static void _update_stream_psr_by_lang(BD_REGISTERS *regs, ...@@ -285,6 +286,14 @@ static void _update_stream_psr_by_lang(BD_REGISTERS *regs,
/* requested language not found */ /* requested language not found */
stream_idx = 0; stream_idx = 0;
enable_flag = 0; enable_flag = 0;
} else {
if (lang) {
*lang = psr_val;
}
if (blacklist == psr_val) {
enable_flag = 0;
}
} }
/* update PSR */ /* update PSR */
...@@ -310,13 +319,16 @@ static void _update_clip_psrs(BLURAY *bd, NAV_CLIP *clip) ...@@ -310,13 +319,16 @@ static void _update_clip_psrs(BLURAY *bd, NAV_CLIP *clip)
*/ */
if (bd->title_type == title_undef) { if (bd->title_type == title_undef) {
MPLS_STN *stn = &clip->title->pl->play_item[clip->ref].stn; MPLS_STN *stn = &clip->title->pl->play_item[clip->ref].stn;
uint32_t audio_lang = 0;
_update_stream_psr_by_lang(bd->regs, _update_stream_psr_by_lang(bd->regs,
PSR_AUDIO_LANG, PSR_PRIMARY_AUDIO_ID, 0, PSR_AUDIO_LANG, PSR_PRIMARY_AUDIO_ID, 0,
stn->audio, stn->num_audio); stn->audio, stn->num_audio,
&audio_lang, 0);
_update_stream_psr_by_lang(bd->regs, _update_stream_psr_by_lang(bd->regs,
PSR_PG_AND_SUB_LANG, PSR_PG_STREAM, 0x80000000, PSR_PG_AND_SUB_LANG, PSR_PG_STREAM, 0x80000000,
stn->pg, stn->num_pg); stn->pg, stn->num_pg,
NULL, audio_lang);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment