]> git.sesse.net Git - vlc/blobdiff - test/libvlc/media_player.c
test: Make sure we wait for the correct state in media_player test.
[vlc] / test / libvlc / media_player.c
index 54f98cdeaae891ad730e7fd05ce16543cdfb1b05..301dc0c18c9133c8c0bb93170b8f69a953db5e18 100644 (file)
@@ -104,6 +104,15 @@ static void test_media_player_pause_stop(const char** argv, int argc)
     assert( state == libvlc_Playing || state == libvlc_MediaPlayerEndReached );
 
     libvlc_media_player_pause (mi, &ex);
+
+    /* Wait a correct state */
+    do {
+        state = libvlc_media_player_get_state (mi, &ex);
+        catch ();
+    } while( state != libvlc_Paused &&
+            state != libvlc_Error &&
+            state != libvlc_MediaPlayerEndReached );
+
     assert( libvlc_media_player_get_state (mi, &ex) == libvlc_Paused );
     catch();