Commit b5bfeaef authored by Rémi Denis-Courmont's avatar 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.
parent 02676b16
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include <vlc_tls.h> #include <vlc_tls.h>
#include <vlc_url.h> #include <vlc_url.h>
#include <vlc_threads.h> #include <vlc_threads.h>
#include <vlc_atomic.h>
#include <cerrno> #include <cerrno>
...@@ -72,7 +71,6 @@ struct sout_stream_sys_t ...@@ -72,7 +71,6 @@ struct sout_stream_sys_t
: p_tls(NULL), i_requestId(0), : p_tls(NULL), i_requestId(0),
i_status(CHROMECAST_DISCONNECTED), p_out(NULL) i_status(CHROMECAST_DISCONNECTED), p_out(NULL)
{ {
atomic_init(&ab_error, false);
} }
std::string serverIP; std::string serverIP;
...@@ -89,7 +87,6 @@ struct sout_stream_sys_t ...@@ -89,7 +87,6 @@ struct sout_stream_sys_t
std::queue<castchannel::CastMessage> messagesToSend; std::queue<castchannel::CastMessage> messagesToSend;
int i_status; int i_status;
atomic_bool ab_error;
vlc_mutex_t lock; vlc_mutex_t lock;
vlc_cond_t loadCommandCond; vlc_cond_t loadCommandCond;
...@@ -190,8 +187,6 @@ static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id, ...@@ -190,8 +187,6 @@ static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer) block_t *p_buffer)
{ {
sout_stream_sys_t *p_sys = p_stream->p_sys; 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); 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 ...@@ -711,7 +706,6 @@ static int processMessage(sout_stream_t *p_stream, const castchannel::CastMessag
else if (type == "LOAD_FAILED") else if (type == "LOAD_FAILED")
{ {
msg_Err(p_stream, "Media load failed"); msg_Err(p_stream, "Media load failed");
atomic_store(&p_sys->ab_error, true);
msgClose(p_stream, p_sys->appTransportId); msgClose(p_stream, p_sys->appTransportId);
vlc_mutex_lock(&p_sys->lock); vlc_mutex_lock(&p_sys->lock);
p_sys->i_status = CHROMECAST_CONNECTION_DEAD; p_sys->i_status = CHROMECAST_CONNECTION_DEAD;
...@@ -941,7 +935,6 @@ static void* chromecastThread(void* p_data) ...@@ -941,7 +935,6 @@ static void* chromecastThread(void* p_data)
msg_Err(p_stream, "The connection to the Chromecast died."); msg_Err(p_stream, "The connection to the Chromecast died.");
vlc_mutex_locker locker(&p_sys->lock); vlc_mutex_locker locker(&p_sys->lock);
p_sys->i_status = CHROMECAST_CONNECTION_DEAD; p_sys->i_status = CHROMECAST_CONNECTION_DEAD;
atomic_store(&p_sys->ab_error, true);
break; break;
} }
...@@ -977,7 +970,6 @@ static void* chromecastThread(void* p_data) ...@@ -977,7 +970,6 @@ static void* chromecastThread(void* p_data)
vlc_mutex_lock(&p_sys->lock); vlc_mutex_lock(&p_sys->lock);
if ( p_sys->i_status == CHROMECAST_CONNECTION_DEAD ) if ( p_sys->i_status == CHROMECAST_CONNECTION_DEAD )
{ {
atomic_store(&p_sys->ab_error, true);
vlc_mutex_unlock(&p_sys->lock); vlc_mutex_unlock(&p_sys->lock);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment