[vlc-devel] commit: Telepathy: Fix a crash. (Mirsal Ennaime )

git version control git at videolan.org
Tue Aug 12 10:15:57 CEST 2008


vlc | branch: master | Mirsal Ennaime <mirsal.ennaime at gmail.com> | Tue Aug 12 00:20:45 2008 +0200| [1d6f5ed52beab9ef1d9b0d3b2e6def4618cca697] | committer: Mirsal Ennaime 

Telepathy: Fix a crash.

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

 modules/misc/notify/notify.c    |    6 +-----
 modules/misc/notify/telepathy.c |    8 +++-----
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/modules/misc/notify/notify.c b/modules/misc/notify/notify.c
index 81b85ca..3a3d3c3 100644
--- a/modules/misc/notify/notify.c
+++ b/modules/misc/notify/notify.c
@@ -144,14 +144,10 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
     char                *psz_artist     = NULL;
     char                *psz_album      = NULL;
     char                *psz_arturl     = NULL;
-    input_thread_t      *p_input        = NULL;
-    playlist_t          * p_playlist    = pl_Yield( p_this );
+    input_thread_t      *p_input        = ((playlist_t*) p_this)->p_input;
     intf_thread_t       *p_intf         = ( intf_thread_t* ) param;
     intf_sys_t          *p_sys          = p_intf->p_sys;
 
-    p_input = p_playlist->p_input;
-    pl_Release( p_this );
-
     if( !p_input ) return VLC_SUCCESS;
     vlc_object_yield( p_input );
 
diff --git a/modules/misc/notify/telepathy.c b/modules/misc/notify/telepathy.c
index 45edea3..4921d46 100644
--- a/modules/misc/notify/telepathy.c
+++ b/modules/misc/notify/telepathy.c
@@ -169,6 +169,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
 {
     VLC_UNUSED(oldval);
     intf_thread_t *p_intf = (intf_thread_t *)param;
+    playlist_t* p_playlist = (playlist_t*) p_this;
     char *psz_buf = NULL;
     input_thread_t *p_input;
 
@@ -193,11 +194,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
         p_intf->p_sys->i_item_changes++;
     }
 
-
-    playlist_t *p_playlist = pl_Yield( p_this );
-
     p_input = p_playlist->p_input;
-    pl_Release( p_this );
 
     if( !p_input ) return VLC_SUCCESS;
     vlc_object_yield( p_input );
@@ -219,7 +216,8 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
         var_AddCallback( p_input, "state", StateChange, p_intf );
 
     /* We format the string to be displayed */
-    psz_buf = str_format_meta( p_this, p_intf->p_sys->psz_format );
+    psz_buf = str_format_meta( (vlc_object_t*) p_intf,
+            p_intf->p_sys->psz_format );
 
     /* We don't need the input anymore */
     vlc_object_release( p_input );




More information about the vlc-devel mailing list