Commit d6bdaf03 authored by Rafaël Carré's avatar Rafaël Carré

telepathy: avoid flooding the bus when playing some special inputs.

parent 4531113a
......@@ -193,7 +193,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
psz_title, psz_artist );
else
snprintf( psz_tmp, MAX_LENGTH, "<b>%s</b>", psz_title );
free( psz_title );
free( psz_artist );
free( psz_album );
......
......@@ -40,6 +40,7 @@ struct intf_sys_t
char *psz_format;
DBusConnection *p_conn;
int i_id;
int i_item-changes;
};
/*****************************************************************************
......@@ -162,9 +163,18 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
if( !strncmp( "playlist-current", psz_var, 16 ) )
{ /* stores the current input item id */
p_intf->p_sys->i_id = newval.i_int;
p_intf->p_sys->i_item-changes = 0;
}
else
{
if( newval.i_int != p_intf->p_sys->i_id ) /* "item-change" */
return VLC_SUCCESS;
/* some variable bitrate inputs call "item-change callbacks each time
* their length is updated, that is several times per second. */
if( p_intf->p_sys->i_item-changes > 5 )
return VLC_SUCCESS;
p_intf->p_sys->i_item-changes++;
}
else if( newval.i_int != p_intf->p_sys->i_id ) /* "item-change" */
return VLC_SUCCESS;
playlist_t *p_playlist = pl_Yield( p_this );
......
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