[vlc-commits] audiotrack: add DTS passthrough

Duncan McNAMARA git at videolan.org
Fri Jul 1 17:57:24 CEST 2016


vlc | branch: master | Duncan McNAMARA <dcn.mcnamara at gmail.com> | Fri Jul  1 16:39:50 2016 +0200| [b6c23127d5514829caea8f7961045e8cf2d9d0c3] | committer: Thomas Guillem

audiotrack: add DTS passthrough

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b6c23127d5514829caea8f7961045e8cf2d9d0c3
---

 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 cd50a8d..f0975a4 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_at_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_at_format = jfields.AudioFormat.ENCODING_DTS;
+            }
+            else if( jfields.AudioFormat.has_ENCODING_PCM_FLOAT )
+            {
+                p_sys->fmt.i_format = VLC_CODEC_FL32;
+                i_at_format = jfields.AudioFormat.ENCODING_PCM_FLOAT;
+            }
+            else
+            {
+                p_sys->fmt.i_format = VLC_CODEC_S16N;
+                i_at_format = jfields.AudioFormat.ENCODING_PCM_16BIT;
+            }
+            break;
         default:
             p_sys->fmt.i_format = VLC_CODEC_S16N;
             i_at_format = jfields.AudioFormat.ENCODING_PCM_16BIT;



More information about the vlc-commits mailing list