- struct sap_announce_t *p_announce;
- mtime_t i_timeout = ( mtime_t ) 1000000*p_sys->i_timeout;
- if( mdate() - p_sd->p_sys->pp_announces[i]->i_last > i_timeout )
- {
- msg_Dbg( p_sd,"Time out for %s, deleting (%i/%i)",
- p_sd->p_sys->pp_announces[i]->psz_name,
- i , p_sd->p_sys->i_announces );
-
- /* Remove the playlist item */
- p_playlist = vlc_object_find( p_sd, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist )
- {
- int i_pos = playlist_GetPositionById( p_playlist,
- p_sd->p_sys->pp_announces[i]->i_id );
- playlist_Delete( p_playlist, i_pos );
- vlc_object_release( p_playlist );
- }
-
- /* Free the p_announce */
- p_announce = p_sd->p_sys->pp_announces[i];
- if( p_announce->psz_name )
- free( p_announce->psz_name );
- if( p_announce->psz_uri )
- free( p_announce->psz_uri );
-
- /* Remove the sap_announce from the array */
- REMOVE_ELEM( p_sd->p_sys->pp_announces,
- p_sd->p_sys->i_announces,
- i );
-
- free( p_announce );
-
- }
+ mtime_t i_timeout = ( mtime_t ) 1000000 * p_sd->p_sys->i_timeout;
+
+ if( mdate() - p_sd->p_sys->pp_announces[i]->i_last > i_timeout )
+ {
+ RemoveAnnounce( p_sd, p_sd->p_sys->pp_announces[i] );
+ }