2 * meta.c - libvlc smoke test
7 /**********************************************************************
8 * Copyright (C) 2008 Pierre d'Herbemont. *
9 * This program is free software; you can redistribute and/or modify *
10 * it under the terms of the GNU General Public License as published *
11 * by the Free Software Foundation; version 2 of the license, or (at *
12 * your option) any later version. *
14 * This program is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
17 * See the GNU General Public License for more details. *
19 * You should have received a copy of the GNU General Public License *
20 * along with this program; if not, you can get it from: *
21 * http://www.gnu.org/copyleft/gpl.html *
22 **********************************************************************/
26 static void test_meta (const char ** argv, int argc)
28 libvlc_instance_t *vlc;
29 libvlc_media_t *media;
32 log ("Testing meta\n");
34 libvlc_exception_init (&ex);
35 vlc = libvlc_new (argc, argv, &ex);
38 media = libvlc_media_new (vlc, "samples/meta.sample", &ex);
41 /* Tell that we are interested in this precise meta data */
42 artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex);
47 /* Wait for the meta */
48 while (!libvlc_media_is_preparsed (media, &ex)) { catch (); msleep (10000); }
50 artist = libvlc_media_get_meta (media, libvlc_meta_Artist, &ex);
53 assert (artist && !strncmp (artist, "mike"), 4);
55 log ("+ got '%s' as Artist\n", artist);
58 libvlc_media_release (media);
67 test_meta (test_defaults_args, test_defaults_nargs);