Commit d5959bcc authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Another thread-unsafe redumdant use of b_dead

parent 36e37a19
...@@ -135,16 +135,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -135,16 +135,9 @@ static int Open( vlc_object_t *p_this )
*****************************************************************************/ *****************************************************************************/
static void Close( vlc_object_t *p_this ) static void Close( vlc_object_t *p_this )
{ {
p_this->b_dead = true;
intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_thread_t *p_intf = (intf_thread_t *)p_this;
playlist_t *p_playlist = pl_Yield( p_this ); playlist_t *p_playlist = pl_Yield( p_this );
/* Clears the Presence message ... else it looks like we're still playing
* something although VLC (or the Telepathy plugin) is closed */
/* Do not check for VLC_ENOMEM as we're closing */
SendToTelepathy( p_intf, "" );
PL_LOCK; PL_LOCK;
var_DelCallback( p_playlist, "item-change", ItemChange, p_intf ); var_DelCallback( p_playlist, "item-change", ItemChange, p_intf );
var_DelCallback( p_playlist, "playlist-current", ItemChange, p_intf ); var_DelCallback( p_playlist, "playlist-current", ItemChange, p_intf );
...@@ -153,6 +146,12 @@ static void Close( vlc_object_t *p_this ) ...@@ -153,6 +146,12 @@ static void Close( vlc_object_t *p_this )
PL_UNLOCK; PL_UNLOCK;
pl_Release( p_this ); pl_Release( p_this );
/* Clears the Presence message ... else it looks like we're still playing
* something although VLC (or the Telepathy plugin) is closed */
/* Do not check for VLC_ENOMEM as we're closing */
SendToTelepathy( p_intf, "" );
/* we won't use the DBus connection anymore */ /* we won't use the DBus connection anymore */
dbus_connection_unref( p_intf->p_sys->p_conn ); dbus_connection_unref( p_intf->p_sys->p_conn );
...@@ -173,9 +172,6 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var, ...@@ -173,9 +172,6 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
char *psz_buf = NULL; char *psz_buf = NULL;
input_thread_t *p_input; input_thread_t *p_input;
if( p_intf->b_dead )
return VLC_EGENERIC;
/* Don't update Telepathy presence each time an item has been preparsed */ /* Don't update Telepathy presence each time an item has been preparsed */
if( !strncmp( "playlist-current", psz_var, 16 ) ) if( !strncmp( "playlist-current", psz_var, 16 ) )
{ /* stores the current input item id */ { /* stores the current input item id */
...@@ -239,8 +235,6 @@ static int StateChange( vlc_object_t *p_this, const char *psz_var, ...@@ -239,8 +235,6 @@ static int StateChange( vlc_object_t *p_this, const char *psz_var,
{ {
VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(oldval); VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(oldval);
intf_thread_t *p_intf = (intf_thread_t *)param; intf_thread_t *p_intf = (intf_thread_t *)param;
if( p_intf->b_dead )
return VLC_EGENERIC;
if( newval.i_int >= END_S ) if( newval.i_int >= END_S )
return SendToTelepathy( p_intf, "" ); return SendToTelepathy( p_intf, "" );
return VLC_SUCCESS; return VLC_SUCCESS;
......
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