[vlc-commits] chromecast: remove useless atomic variable

Rémi Denis-Courmont git at videolan.org
Thu Jun 25 23:09:28 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jun 25 23:36:59 2015 +0300| [b5bfeaef52516e21b6a5224382cdd3298f82dfb5] | committer: Rémi Denis-Courmont

chromecast: remove useless atomic variable

The sequencing (or lack thereof) is such that the underlying output
must be able to cope anyway. Also, this fixes a massive memory leak.

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

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

diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index d609e49..a11b7ce 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -39,7 +39,6 @@
 #include <vlc_tls.h>
 #include <vlc_url.h>
 #include <vlc_threads.h>
-#include <vlc_atomic.h>
 
 #include <cerrno>
 
@@ -72,7 +71,6 @@ struct sout_stream_sys_t
         : p_tls(NULL), i_requestId(0),
           i_status(CHROMECAST_DISCONNECTED), p_out(NULL)
     {
-        atomic_init(&ab_error, false);
     }
 
     std::string serverIP;
@@ -89,7 +87,6 @@ struct sout_stream_sys_t
     std::queue<castchannel::CastMessage> messagesToSend;
 
     int i_status;
-    atomic_bool ab_error;
     vlc_mutex_t lock;
     vlc_cond_t loadCommandCond;
 
@@ -190,8 +187,6 @@ static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
                 block_t *p_buffer)
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
-    if (atomic_load(&p_sys->ab_error))
-        return VLC_EGENERIC;
 
     return p_sys->p_out->pf_send(p_sys->p_out, id, p_buffer);
 }
@@ -711,7 +706,6 @@ static int processMessage(sout_stream_t *p_stream, const castchannel::CastMessag
         else if (type == "LOAD_FAILED")
         {
             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;
@@ -941,7 +935,6 @@ static void* chromecastThread(void* p_data)
             msg_Err(p_stream, "The connection to the Chromecast died.");
             vlc_mutex_locker locker(&p_sys->lock);
             p_sys->i_status = CHROMECAST_CONNECTION_DEAD;
-            atomic_store(&p_sys->ab_error, true);
             break;
         }
 
@@ -977,7 +970,6 @@ static void* chromecastThread(void* p_data)
         vlc_mutex_lock(&p_sys->lock);
         if ( p_sys->i_status == CHROMECAST_CONNECTION_DEAD )
         {
-            atomic_store(&p_sys->ab_error, true);
             vlc_mutex_unlock(&p_sys->lock);
             break;
         }



More information about the vlc-commits mailing list