[vlc-devel] commit: test: Report when preparsed is working only when it works. ( Pierre d'Herbemont )

git version control git at videolan.org
Thu Feb 25 23:47:00 CET 2010


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Thu Feb 25 23:15:48 2010 +0100| [16511fee7c80ba34d176a20c40cd7e341241a441] | committer: Pierre d'Herbemont 

test: Report when preparsed is working only when it works.

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

 test/libvlc/media.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/libvlc/media.c b/test/libvlc/media.c
index 1547aae..e66095e 100644
--- a/test/libvlc/media.c
+++ b/test/libvlc/media.c
@@ -57,15 +57,17 @@ static void test_media_preparsed(const char** argv, int argc)
     while (!received);
 
     // We are good, now check Elementary Stream info.
-    libvlc_media_track_info_t *tracks;
+    libvlc_media_track_info_t *tracks = NULL;
     int num = libvlc_media_get_tracks_info(media, &tracks);
 
 #warning libvlc_media_get_tracks_info is a broken function.
     // This is broken.
     // assert(num == 1);
-    printf("WARNING: libvlc_media_get_tracks_info is not working.");
+    if (num != 1)
+        printf("WARNING: libvlc_media_get_tracks_info is not working.");
 
-    free(tracks);
+    if (num > 0)
+        free(tracks);
 
     libvlc_media_release (media);
     libvlc_release (vlc);




More information about the vlc-devel mailing list