[vlc-commits] chromecast: Add a setting to enable/disable casting multichannel PCM

Hugo Beauzée-Luyssen git at videolan.org
Tue Jan 16 17:29:21 CET 2018


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jan 15 17:45:13 2018 +0100| [2be0e04d11175229c9c576f858d6403cd5614b7e] | committer: Hugo Beauzée-Luyssen

chromecast: Add a setting to enable/disable casting multichannel PCM

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

 modules/stream_out/chromecast/cast.cpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index a8e2db3ef0..b1bb1344cb 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -83,7 +83,8 @@ struct sout_stream_sys_t
 
 private:
     bool UpdateOutput( sout_stream_t * );
-    vlc_fourcc_t transcodeAudioFourCC( const audio_format_t* p_fmt );
+    vlc_fourcc_t transcodeAudioFourCC( sout_stream_t* p_stream,
+                                       const audio_format_t* p_fmt );
 
 };
 
@@ -121,6 +122,8 @@ static const char *const ppsz_sout_options[] = {
 #define PERF_LONGTEXT N_( "Display a performance warning when transcoding" )
 #define AUDIO_PASSTHROUGH_TEXT N_( "Enable Audio passthrough" )
 #define AUDIO_PASSTHROUGH_LONGTEXT N_( "Disable if your receiver does not support Dolby®" )
+#define MULTICHANNEL_PCM_TEXT N_( "Multichannel PCM" )
+#define MULTICHANNEL_PCM_LONGTEXT N_( "Use PCM for multichannel audio." )
 
 #define IP_ADDR_TEXT N_("IP Address")
 #define IP_ADDR_LONGTEXT N_("IP Address of the Chromecast.")
@@ -145,6 +148,7 @@ vlc_module_begin ()
     add_string(SOUT_CFG_PREFIX "mime", "video/x-matroska", MIME_TEXT, MIME_LONGTEXT, false)
     add_integer(SOUT_CFG_PREFIX "show-perf-warning", 1, PERF_TEXT, PERF_LONGTEXT, true )
     add_bool(SOUT_CFG_PREFIX "audio-passthrough", true, AUDIO_PASSTHROUGH_TEXT, AUDIO_PASSTHROUGH_LONGTEXT, false )
+    add_bool(SOUT_CFG_PREFIX "multichannel-pcm", true, MULTICHANNEL_PCM_TEXT, MULTICHANNEL_PCM_LONGTEXT, false );
 
 
 vlc_module_end ()
@@ -259,9 +263,11 @@ bool sout_stream_sys_t::canDecodeAudio( sout_stream_t *p_stream,
            i_codec == VLC_CODEC_MP3;
 }
 
-vlc_fourcc_t sout_stream_sys_t::transcodeAudioFourCC( const audio_format_t* p_fmt )
+vlc_fourcc_t sout_stream_sys_t::transcodeAudioFourCC( sout_stream_t *p_stream,
+                                                      const audio_format_t* p_fmt )
 {
-    if ( p_fmt->i_channels > 2 )
+    if ( p_fmt->i_channels > 2 &&
+         var_InheritBool( p_stream, SOUT_CFG_PREFIX "multichannel-pcm" ) )
         return VLC_CODEC_S16L;
     return VLC_CODEC_MP3;
 }
@@ -376,7 +382,7 @@ bool sout_stream_sys_t::UpdateOutput( sout_stream_t *p_stream )
         char s_fourcc[5];
         if ( i_codec_audio == 0 && p_original_audio )
         {
-            i_codec_audio = transcodeAudioFourCC( &p_original_audio->audio );
+            i_codec_audio = transcodeAudioFourCC( p_stream, &p_original_audio->audio );
             msg_Dbg( p_stream, "Converting audio to %.4s", (const char*)&i_codec_audio );
             ssout << "acodec=";
             vlc_fourcc_to_char( i_codec_audio, s_fourcc );



More information about the vlc-commits mailing list