No need to check for a NULL as libvlc_media_release is checking.
authorRémi Duraffort <ivoire@videolan.org>
Wed, 20 May 2009 18:55:55 +0000 (20:55 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 20 May 2009 18:56:18 +0000 (20:56 +0200)
src/control/media_list.c
src/control/media_player.c

index e043c4c..75389c6 100644 (file)
@@ -201,8 +201,7 @@ void libvlc_media_list_release( libvlc_media_list_t * p_mlist )
 
     libvlc_event_manager_release( p_mlist->p_event_manager );
 
-    if( p_mlist->p_md )
-        libvlc_media_release( p_mlist->p_md );
+    libvlc_media_release( p_mlist->p_md );
 
     for ( i = 0; i < vlc_array_count( &p_mlist->items ); i++ )
     {
@@ -279,8 +278,7 @@ void libvlc_media_list_set_media( libvlc_media_list_t * p_mlist,
 {
     VLC_UNUSED(p_e);
     vlc_mutex_lock( &p_mlist->object_lock );
-    if( p_mlist->p_md )
-        libvlc_media_release( p_mlist->p_md );
+    libvlc_media_release( p_mlist->p_md );
     libvlc_media_retain( p_md );
     p_mlist->p_md = p_md;
     vlc_mutex_unlock( &p_mlist->object_lock );
index 126eef9..48b4b76 100644 (file)
@@ -391,8 +391,7 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
         release_input_thread( p_mi, true );
 
     libvlc_event_manager_release( p_mi->p_event_manager );
-    if( p_mi->p_md )
-        libvlc_media_release( p_mi->p_md );
+    libvlc_media_release( p_mi->p_md );
     vlc_mutex_destroy( &p_mi->object_lock );
     free( p_mi );
 }