[vlc-commits] sout: chromecast: close connection on load failure

Francois Cartegnie git at videolan.org
Thu Oct 9 00:08:09 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct  7 18:12:13 2014 +0200| [034ce48d5f028549c892c083f27b1c3c6c5df8da] | committer: Francois Cartegnie

sout: chromecast: close connection on load failure

only msgClose won't stop listening, so we need to
flag as CONN_DEAD as well so it will send the close
message and exit thread

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=034ce48d5f028549c892c083f27b1c3c6c5df8da
---

 modules/stream_out/chromecast/cast.cpp |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index b0e4166..7a93648 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -673,7 +673,9 @@ static int processMessage(sout_stream_t *p_stream, const castchannel::CastMessag
                 case CHROMECAST_MEDIA_LOAD_SENT:
                     msg_Warn(p_stream, "app is no longer present. closing");
                     msgClose(p_stream, p_sys->appTransportId);
-                    i_ret = -1;
+                    vlc_mutex_lock(&p_sys->lock);
+                    p_sys->i_status = CHROMECAST_CONNECTION_DEAD;
+                    vlc_mutex_unlock(&p_sys->lock);
                     // ft
                 default:
                     break;
@@ -706,6 +708,10 @@ static int processMessage(sout_stream_t *p_stream, const castchannel::CastMessag
         {
             msg_Err(p_stream, "Media load failed");
             atomic_store(&p_sys->ab_error, true);
+            msgClose(p_stream, p_sys->appTransportId);
+            vlc_mutex_lock(&p_sys->lock);
+            p_sys->i_status = CHROMECAST_CONNECTION_DEAD;
+            vlc_mutex_unlock(&p_sys->lock);
         }
         else
         {



More information about the vlc-commits mailing list