[vlc-devel] [PATCH 2/2] audiotrack : added DTS passthrough

Duncan McNAMARA dcn.mcnamara at gmail.com
Fri Jul 1 14:05:36 CEST 2016


---
 modules/audio_output/audiotrack.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index 438f330..7bf88f1 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -215,6 +215,10 @@ static struct
         jint ENCODING_AC3;
         jint ENCODING_E_AC3;
         bool has_ENCODING_AC3;
+        jint ENCODING_DTS;
+        bool has_ENCODING_DTS;
+        jint ENCODING_DTS_HD;
+        bool has_ENCODING_DTS_HD;
         jint CHANNEL_OUT_MONO;
         jint CHANNEL_OUT_STEREO;
         jint CHANNEL_OUT_FRONT_LEFT;
@@ -379,6 +383,14 @@ InitJNIFields( audio_output_t *p_aout, JNIEnv* env )
         jfields.AudioFormat.has_ENCODING_AC3 = field != NULL;
     } else
         jfields.AudioFormat.has_ENCODING_AC3 = false;
+    GET_CONST_INT( AudioFormat.ENCODING_DTS, "ENCODING_DTS", false );
+    if ( field != NULL )
+    {
+        GET_CONST_INT( AudioFormat.ENCODING_DTS_HD, "ENCODING_DTS_HD", false );
+        jfields.AudioFormat.has_ENCODING_DTS = field != NULL;
+    }
+    else
+        jfields.AudioFormat.has_ENCODING_DTS = false;
 
     GET_CONST_INT( AudioFormat.CHANNEL_OUT_MONO, "CHANNEL_OUT_MONO", true );
     GET_CONST_INT( AudioFormat.CHANNEL_OUT_STEREO, "CHANNEL_OUT_STEREO", true );
@@ -953,6 +965,23 @@ Start( audio_output_t *p_aout, audio_sample_format_t *restrict p_fmt )
                 i_format = jfields.AudioFormat.ENCODING_PCM_16BIT;
             }
             break;
+        case VLC_CODEC_DTS:
+            if ( jfields.AudioFormat.has_ENCODING_DTS && b_spdif )
+            {
+                p_sys->fmt.i_format = VLC_CODEC_SPDIFB;
+                i_format = jfields.AudioFormat.ENCODING_DTS;
+            }
+            else if ( jfields.AudioFormat.has_ENCODING_PCM_FLOAT )
+            {
+                p_sys->fmt.i_format = VLC_CODEC_FL32;
+                i_format = jfields.AudioFormat.ENCODING_PCM_FLOAT;
+            }
+            else
+            {
+                p_sys->fmt.i_format = VLC_CODEC_S16N;
+                i_format = jfields.AudioFormat.ENCODING_PCM_16BIT;
+            }
+            break;
         default:
             p_sys->fmt.i_format = VLC_CODEC_S16N;
             i_format = jfields.AudioFormat.ENCODING_PCM_16BIT;
-- 
2.5.5



More information about the vlc-devel mailing list