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

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


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jan 15 17:45:13 2018 +0100| [8958d4f7448aecdee42a9cd6e27e8ac6d2f7c222] | 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=8958d4f7448aecdee42a9cd6e27e8ac6d2f7c222
---

 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 0a4023bae7..a47d3afe18 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", false, AUDIO_PASSTHROUGH_TEXT, AUDIO_PASSTHROUGH_LONGTEXT, false )
+    add_bool(SOUT_CFG_PREFIX "multichannel-pcm", false, 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