[vlc-devel] [PATCH 3/4] audiotrack: use audio.i_profile for dtshd detection
Thomas Guillem
thomas at gllm.fr
Fri Mar 30 15:15:24 CEST 2018
---
modules/audio_output/audiotrack.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index 238826bb95..56be5e9bf7 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -923,7 +923,7 @@ AudioTrack_Create( JNIEnv *env, audio_output_t *p_aout,
}
static bool
-AudioTrack_HasEncoding( audio_output_t *p_aout, vlc_fourcc_t i_format,
+AudioTrack_HasEncoding( audio_output_t *p_aout, vlc_fourcc_t i_format, int i_profile,
bool *p_dtshd )
{
aout_sys_t *p_sys = p_aout->sys;
@@ -935,8 +935,7 @@ AudioTrack_HasEncoding( audio_output_t *p_aout, vlc_fourcc_t i_format,
switch( i_format )
{
case VLC_CODEC_DTS:
- if( MATCH_ENCODING_FLAG( ENCODING_DTS_HD )
- && var_GetBool( p_aout, "dtshd" ) )
+ if( MATCH_ENCODING_FLAG( ENCODING_DTS_HD ) && i_profile > 0 )
{
*p_dtshd = true;
return true;
@@ -963,7 +962,8 @@ StartPassthrough( JNIEnv *env, audio_output_t *p_aout )
if( jfields.AudioFormat.has_ENCODING_IEC61937 )
{
bool b_dtshd;
- if( !AudioTrack_HasEncoding( p_aout, p_sys->fmt.i_format, &b_dtshd ) )
+ if( !AudioTrack_HasEncoding( p_aout, p_sys->fmt.i_format,
+ p_sys->fmt.i_profile, &b_dtshd ) )
return VLC_EGENERIC;
i_at_format = jfields.AudioFormat.ENCODING_IEC61937;
switch( p_sys->fmt.i_format )
@@ -1939,7 +1939,7 @@ static int DeviceSelect(audio_output_t *p_aout, const char *p_id)
i < sizeof( enc_fourccs ) / sizeof( enc_fourccs[0] ); ++i )
{
bool b_dtshd;
- if( AudioTrack_HasEncoding( p_aout, enc_fourccs[i], &b_dtshd ) )
+ if( AudioTrack_HasEncoding( p_aout, enc_fourccs[i], 1, &b_dtshd ) )
msg_Dbg( p_aout, "device has %4.4s passthrough support",
b_dtshd ? "dtsh" : (const char *)&enc_fourccs[i] );
}
--
2.11.0
More information about the vlc-devel
mailing list