[vlc-devel] commit: test: Make sure we wait for the correct state in media_player test. (Pierre d'Herbemont )

git version control git at videolan.org
Thu May 21 07:06:04 CEST 2009


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Tue May 19 22:59:36 2009 -0700| [c96990194eacc6585a4a249a6805d18d1defbea7] | committer: Pierre d'Herbemont 

test: Make sure we wait for the correct state in media_player test.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c96990194eacc6585a4a249a6805d18d1defbea7
---

 test/libvlc/media_player.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/test/libvlc/media_player.c b/test/libvlc/media_player.c
index 54f98cd..301dc0c 100644
--- a/test/libvlc/media_player.c
+++ b/test/libvlc/media_player.c
@@ -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();
 




More information about the vlc-devel mailing list