[vlc-devel] [PATCH] chromecast: reload the file if the previous LOAD was canceled

Steve Lhomme robux4 at videolabs.io
Thu Aug 4 18:56:45 CEST 2016


It happens when we STOP the previous file that was in BUFFERING state, the
next LOAD command always gets canceled.
---
 modules/stream_out/chromecast/chromecast_ctrl.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index 4d3b9f3..c39fe27 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -536,6 +536,7 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
             vlc_mutex_locker locker(&lock);
             receiver_state oldPlayerState = receiverState;
             std::string newPlayerState = status[0]["playerState"].operator const char *();
+            std::string idleReason = status[0]["idleReason"].operator const char *();
 
             if (newPlayerState == "IDLE")
                 receiverState = RECEIVER_IDLE;
@@ -641,7 +642,7 @@ void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
                 vlc_cond_signal( &seekCommandCond );
             }
 
-            if ( cmd_status != CMD_LOAD_SENT && receiverState == RECEIVER_IDLE && has_input )
+            if ( (cmd_status != CMD_LOAD_SENT || idleReason == "CANCELLED") && receiverState == RECEIVER_IDLE && has_input )
             {
                 msg_Dbg( p_module, "the device missed the LOAD command");
                 i_ts_local_start = VLC_TS_0;
-- 
2.8.2



More information about the vlc-devel mailing list