[vlc-devel] commit: test: Update libvlc_media test. (Pierre d'Herbemont )
git version control
git at videolan.org
Mon Feb 22 18:36:14 CET 2010
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Mon Feb 22 17:37:39 2010 +0100| [ad916056154d04e42576bcd153491de2bd646a9f] | committer: Pierre d'Herbemont
test: Update libvlc_media test.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ad916056154d04e42576bcd153491de2bd646a9f
---
test/libvlc/media.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/test/libvlc/media.c b/test/libvlc/media.c
index 19d1402..5ac5ec6 100644
--- a/test/libvlc/media.c
+++ b/test/libvlc/media.c
@@ -43,21 +43,21 @@ static void test_media_preparsed(const char** argv, int argc)
libvlc_media_t *media = libvlc_media_new_path (vlc, file);
assert (media != NULL);
- int received = false;
-
- // Force preparsing. FIXME - Expose a better API for that.
- libvlc_media_es_t *es;
- int num = libvlc_media_get_es(media, &es);
- free(es);
+ volatile int received = false;
+ // Check to see if we are properly receiving the event.
libvlc_event_manager_t *em = libvlc_media_event_manager (media);
libvlc_event_attach (em, libvlc_MediaPreparsedChanged, preparsed_changed, &received);
+ // Parse the media. This is synchronous.
+ libvlc_media_parse(media);
+
// Wait to see if we properly receive preparsed.
while (!received);
// We are good, now check Elementary Stream info.
- num = libvlc_media_get_es(media, &es);
+ libvlc_media_es_t *es;
+ int num = libvlc_media_get_es(media, &es);
assert(num > 0);
free(es);
More information about the vlc-devel
mailing list