[vlc-commits] chromecast: autoclean in case of failure

Thomas Guillem git at videolan.org
Thu Feb 1 14:18:36 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb  1 13:37:27 2018 +0100| [3c9a2af77f5418719a440163bcf41df86ca70ea5] | committer: Thomas Guillem

chromecast: autoclean in case of failure

A method should clean itself in case of failure.

(cherry picked from commit 4b5e0dc65372993c9767afa4c603bdde345b8729)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=3c9a2af77f5418719a440163bcf41df86ca70ea5
---

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

diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index 41f86f3fb8..be19d9f2f6 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -687,7 +687,14 @@ bool sout_stream_sys_t::startSoutChain(sout_stream_t *p_stream,
         else
             ++it;
     }
-    return out_streams.empty() == false;
+
+    if (out_streams.empty())
+    {
+        stopSoutChain( p_stream );
+        access_out_live.clear();
+        return false;
+    }
+    return true;
 }
 
 bool sout_stream_sys_t::UpdateOutput( sout_stream_t *p_stream )
@@ -890,13 +897,8 @@ bool sout_stream_sys_t::UpdateOutput( sout_stream_t *p_stream )
           << ",access=chromecast-http";
 
     if ( !startSoutChain( p_stream, new_streams, ssout.str() ) )
-    {
         p_intf->requestPlayerStop();
 
-        sout_StreamChainDelete( p_out, NULL );
-        access_out_live.clear();
-        p_out = NULL;
-    }
     return true;
 }
 



More information about the vlc-commits mailing list