[vlc-devel] [PATCH 06/10] chromecast: send the volume and mute values when about to start playback

Steve Lhomme robux4 at videolabs.io
Tue May 31 13:15:33 CEST 2016


---
 modules/stream_out/chromecast/chromecast_ctrl.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index e3f5b38..202f486 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -580,6 +580,11 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
                         msg_Dbg( p_module, "Playback pending with an offset of %" PRId64, m_chromecast_start_time);
                     }
                     m_time_playback_started = VLC_TS_INVALID;
+                    if (!mediaSessionId.empty())
+                    {
+                        msgPlayerSetMute( var_InheritBool( p_module, "mute" ) );
+                        msgPlayerSetVolume( var_InheritFloat( p_module, "volume" ) );
+                    }
                     break;
 
                 case RECEIVER_PLAYING:
@@ -596,6 +601,12 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
                     break;
 
                 case RECEIVER_PAUSED:
+                    if (!mediaSessionId.empty())
+                    {
+                        msgPlayerSetMute( var_InheritBool( p_module, "mute" ) );
+                        msgPlayerSetVolume( var_InheritFloat( p_module, "volume" ) );
+                    }
+
                     m_chromecast_start_time = (1 + mtime_t( double( status[0]["currentTime"] ) ) ) * 1000000L;
 #ifndef NDEBUG
                     msg_Dbg( p_module, "Playback paused with an offset of %" PRId64 " date_play_start:%" PRId64, m_chromecast_start_time, m_time_playback_started);
-- 
2.7.0



More information about the vlc-devel mailing list