[vlc-commits] commit: Test libvlc_media_player_set_pause() ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun Jun 27 15:54:29 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun 27 16:54:07 2010 +0300| [2a14fb71bc4b3cd817856d2187305b0529c0a629] | committer: Rémi Denis-Courmont 

Test libvlc_media_player_set_pause()

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

 test/libvlc/media_player.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/test/libvlc/media_player.c b/test/libvlc/media_player.c
index 53ba3d6..0b0be8d 100644
--- a/test/libvlc/media_player.c
+++ b/test/libvlc/media_player.c
@@ -36,6 +36,18 @@ static void wait_playing(libvlc_media_player_t *mp)
     assert(state == libvlc_Playing || state == libvlc_Ended);
 }
 
+static void wait_paused(libvlc_media_player_t *mp)
+{
+    libvlc_state_t state;
+    do {
+        state = libvlc_media_player_get_state (mp);
+    } while(state != libvlc_Paused &&
+            state != libvlc_Ended );
+
+    state = libvlc_media_player_get_state (mp);
+    assert(state == libvlc_Paused || state == libvlc_Ended);
+}
+
 static void test_media_player_set_media(const char** argv, int argc)
 {
     const char * file = test_default_sample;
@@ -119,15 +131,9 @@ static void test_media_player_pause_stop(const char** argv, int argc)
 
     wait_playing (mi);
 
-#if 0
-    /* This can't work because under some condition (short file, this is the case) this will be
-     * equivalent to a play() */
-    libvlc_media_player_pause (mi);
-
+    libvlc_media_player_set_pause (mi, true);
     log ("Waiting for pause\n");
-
-    wait_paused (mp);
-#endif
+    wait_paused (mi);
 
     libvlc_media_player_stop (mi);
     libvlc_media_player_release (mi);



More information about the vlc-commits mailing list