]> git.sesse.net Git - vlc/blobdiff - test/libvlc/meta.c
Don't leak references to card when we have more than one.
[vlc] / test / libvlc / meta.c
index c969a01b9726b0099947b19a7918dc413265eb57..aa29c98406f8444de7a3c6d3a59b621fd9e4ed1a 100644 (file)
@@ -22,7 +22,7 @@
  *  http://www.gnu.org/copyleft/gpl.html                              *
  **********************************************************************/
 
-#include <strings.h>
+#include <string.h>
 
 #include "test.h"
 
@@ -34,25 +34,13 @@ static void test_meta (const char ** argv, int argc)
 
     log ("Testing meta\n");
 
-    libvlc_exception_init (&ex);
-    vlc = libvlc_new (argc, argv, &ex);
-    catch ();
+    vlc = libvlc_new (argc, argv);
+    assert (vlc != NULL);
 
-    media = libvlc_media_new (vlc, "samples/meta.sample", &ex);
-    catch ();
+    media = libvlc_media_new_path (vlc, "samples/meta.sample");
+    assert( media );
 
-    /* Tell that we are interested in this precise meta data
-     * This is needed to trigger meta data reading
-     * (the first calls return NULL) */
-    artist = libvlc_media_get_meta (media, libvlc_meta_Artist);
-
-    free (artist);
-
-    /* Wait for the meta */
-    while (!libvlc_media_is_preparsed (media))
-    {
-        usleep (10000);
-    }
+    libvlc_media_parse (media);
 
     artist = libvlc_media_get_meta (media, libvlc_meta_Artist);