[vlc-devel] commit: Another thread-unsafe redumdant use of b_dead ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Sep 14 16:37:51 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Sep 14 17:40:57 2008 +0300| [d5959bcc5f9f44c54a7a480f8ce64c5439ab0da3] | committer: Rémi Denis-Courmont
Another thread-unsafe redumdant use of b_dead
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d5959bcc5f9f44c54a7a480f8ce64c5439ab0da3
---
modules/misc/notify/telepathy.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/modules/misc/notify/telepathy.c b/modules/misc/notify/telepathy.c
index 4921d46..3dd5eaf 100644
--- a/modules/misc/notify/telepathy.c
+++ b/modules/misc/notify/telepathy.c
@@ -135,16 +135,9 @@ static int Open( 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;
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;
var_DelCallback( p_playlist, "item-change", ItemChange, p_intf );
var_DelCallback( p_playlist, "playlist-current", ItemChange, p_intf );
@@ -153,6 +146,12 @@ static void Close( vlc_object_t *p_this )
PL_UNLOCK;
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 */
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,
char *psz_buf = NULL;
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 */
if( !strncmp( "playlist-current", psz_var, 16 ) )
{ /* stores the current input item id */
@@ -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);
intf_thread_t *p_intf = (intf_thread_t *)param;
- if( p_intf->b_dead )
- return VLC_EGENERIC;
if( newval.i_int >= END_S )
return SendToTelepathy( p_intf, "" );
return VLC_SUCCESS;
More information about the vlc-devel
mailing list