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 @@
#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;
}
......
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