]> git.sesse.net Git - vlc/commitdiff
check if media_list_player->media_list is null before locking - fixes #1524
authorFilippo Carone <littlejohn@videolan.org>
Mon, 17 Mar 2008 22:19:25 +0000 (23:19 +0100)
committerFilippo Carone <littlejohn@videolan.org>
Mon, 17 Mar 2008 22:19:25 +0000 (23:19 +0100)
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
src/control/media_list_player.c

index 191a19a9cb621148cc517d58d4a47a459ca8d2ac..e70211aa0460a8b548d073885626449076a7c265 100644 (file)
@@ -101,15 +101,13 @@ public class MediaListPlayerTest
         Assert.assertEquals(0, exception.raised);
     }
 
-//    @Test
-    /**
-     * This test is disabled: see https://trac.videolan.org/vlc/ticket/1524
-     */
+    @Test
     public void mediaListPlayerPlayNoItemTest()
     {
         libvlc_exception_t exception = new libvlc_exception_t();
         LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
         libvlc.libvlc_media_list_player_play(mediaListPlayer, exception);
+        Assert.assertEquals(1, exception.raised);
     }
 
 }
index 75b467b2cd4ec2c771e8d5045c34e8fe399857d0..a1239f8c295d6e9292dacdaaa0f602ec9616aa4d 100644 (file)
@@ -40,6 +40,7 @@ get_next_path( libvlc_media_list_player_t * p_mlp )
     libvlc_media_list_path_t ret;
     libvlc_media_list_t * p_parent_of_playing_item;
     libvlc_media_list_t * p_sublist_of_playing_item;
+
     p_sublist_of_playing_item = libvlc_media_list_sublist_at_path(
                             p_mlp->p_mlist,
                             p_mlp->current_playing_item_path );
@@ -427,6 +428,12 @@ void libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
                                     libvlc_exception_t * p_e )
 {    
     libvlc_media_list_path_t path;
+
+    if (! p_mlp->p_mlist )
+    {
+        libvlc_exception_raise( p_e, "No more element to play" );
+        return;
+    }
     
     libvlc_media_list_lock( p_mlp->p_mlist );