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

Steve Lhomme robux4 at videolabs.io
Tue May 3 16:01:43 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 eccadcf..8df7409 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -582,6 +582,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:
@@ -598,6 +603,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