[vlc-commits] growl: fix crash and duplicated notifications in some cases
David Fuhrmann
git at videolan.org
Wed May 30 20:18:51 CEST 2012
vlc/vlc-2.0 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Wed May 30 20:12:01 2012 +0200| [f00c824bb9a2001ae0160326bd0fb173873f4280] | committer: David Fuhrmann
growl: fix crash and duplicated notifications in some cases
(cherry picked from commit b10e58173a1190b06cd8826147cc8ac36b04d9a3)
Conflicts:
modules/notify/growl.m
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=f00c824bb9a2001ae0160326bd0fb173873f4280
---
modules/notify/growl.m | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/modules/notify/growl.m b/modules/notify/growl.m
index 86eb626..c3bf25f 100644
--- a/modules/notify/growl.m
+++ b/modules/notify/growl.m
@@ -167,19 +167,22 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
/* Don't update each time an item has been preparsed */
if( b_is_item_current )
{ /* stores the current input item id */
- p_intf->p_sys->i_id = p_item->i_id;
- p_intf->p_sys->i_item_changes = 0;
+ if( p_intf->p_sys->i_id != p_item->i_id )
+ {
+ p_intf->p_sys->i_id = p_item->i_id;
+ p_intf->p_sys->i_item_changes = 0;
+ }
return VLC_SUCCESS;
}
/* ignore items which weren't pre-parsed yet */
else if( !input_item_IsPreparsed(p_item) )
return VLC_SUCCESS;
else
- {
- if( p_item->i_id != p_intf->p_sys->i_id ) { /* "item-change" */
- p_intf->p_sys->i_item_changes = 0;
+ { /* "item-change" */
+
+ if( p_item->i_id != p_intf->p_sys->i_id )
return VLC_SUCCESS;
- }
+
/* Some variable bitrate inputs call "item-change" callbacks each time
* their length is updated, that is several times per second.
* We'll limit the number of changes to 1 per input. */
@@ -189,17 +192,6 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
p_intf->p_sys->i_item_changes++;
}
- input_thread_t *p_input = playlist_CurrentInput( (playlist_t*)p_this );
-
- if( !p_input ) return VLC_SUCCESS;
-
- if( p_input->b_dead || !input_GetItem(p_input)->psz_name )
- {
- /* Not playing anything ... */
- vlc_object_release( p_input );
- return VLC_SUCCESS;
- }
-
/* Playing something ... */
if( input_item_GetNowPlaying( p_item ) )
psz_title = input_item_GetNowPlaying( p_item );
@@ -208,7 +200,6 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
if( EMPTY_STR( psz_title ) )
{
free( psz_title );
- vlc_object_release( p_input );
return VLC_SUCCESS;
}
@@ -231,7 +222,6 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
free( psz_title );
free( psz_artist );
free( psz_album );
- vlc_object_release( p_input );
return VLC_ENOMEM;
}
@@ -251,7 +241,6 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
free( psz_arturl );
free( psz_tmp );
- vlc_object_release( p_input );
return VLC_SUCCESS;
}
More information about the vlc-commits
mailing list