]> git.sesse.net Git - vlc/blobdiff - test/libvlc/media_list_player.c
test: Disable test_media_list_player as it deadlocks.
[vlc] / test / libvlc / media_list_player.c
index fbc67bf8a21d49a0bf01cc37e65d2861051c462a..56fbb437dd01392bc006976fe88b95f32d1f400f 100644 (file)
 
 #include "test.h"
 
+ // For msleep
+#include <vlc_common.h>
+#include <vlc_mtime.h>
+
 static void media_list_add_file_path(libvlc_instance_t *vlc, libvlc_media_list_t *ml, const char * file_path)
 {
     libvlc_media_t *md = libvlc_media_new (vlc, file_path, &ex);
@@ -73,7 +77,7 @@ static void test_media_list_player_next(const char** argv, int argc)
 
     libvlc_media_release (md);
 
-    usleep(500000);
+    msleep(100000);
     
     libvlc_media_list_player_next (mlp, &ex);
     catch ();
@@ -81,7 +85,7 @@ static void test_media_list_player_next(const char** argv, int argc)
     libvlc_media_list_player_pause (mlp, &ex);
     catch();
 
-    usleep(500000);
+    msleep(100000);
     
     libvlc_media_list_player_next (mlp, &ex);
     catch ();
@@ -89,7 +93,7 @@ static void test_media_list_player_next(const char** argv, int argc)
     libvlc_media_list_player_stop (mlp, &ex);
     catch ();
 
-    usleep(500000);
+    msleep(100000);
     
     libvlc_media_list_player_next (mlp, &ex);
     catch ();
@@ -170,8 +174,11 @@ static void test_media_list_player_play_item_at_index(const char** argv, int arg
 
     mlp = libvlc_media_list_player_new (vlc, &ex);
 
-    libvlc_media_list_add_media( ml, md, &ex );
-    catch ();
+    for (unsigned i = 0; i < 5; i++)
+    {
+        libvlc_media_list_add_media( ml, md, &ex );
+        catch ();
+    }
 
     libvlc_media_list_player_set_media_list( mlp, ml, &ex );
 
@@ -198,8 +205,7 @@ int main (void)
 
     test_media_list_player_pause_stop (test_defaults_args, test_defaults_nargs);
     test_media_list_player_play_item_at_index (test_defaults_args, test_defaults_nargs);
-    if(0) // Core hangs here, because it doesn't support callback removal from callbacks (variable)
-        test_media_list_player_next (test_defaults_args, test_defaults_nargs);
+    test_media_list_player_next (test_defaults_args, test_defaults_nargs);
 
     return 0;
 }