[Android] Thumbnailer: use also the new track_info methods

Jean-Baptiste Kempf git at videolan.org
Thu Feb 28 10:43:13 CET 2013


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Feb 28 10:41:17 2013 +0100| [41ac75750062000cda1bd6fb12e2361718de1e6b] | committer: Jean-Baptiste Kempf

Thumbnailer: use also the new track_info methods

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=41ac75750062000cda1bd6fb12e2361718de1e6b
---

 vlc-android/jni/thumbnailer.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/vlc-android/jni/thumbnailer.c b/vlc-android/jni/thumbnailer.c
index 4c03150..54e1282 100644
--- a/vlc-android/jni/thumbnailer.c
+++ b/vlc-android/jni/thumbnailer.c
@@ -171,24 +171,24 @@ jbyteArray Java_org_videolan_vlc_LibVLC_getThumbnail(JNIEnv *env, jobject thiz,
     libvlc_media_player_set_media(mp, m);
 
     /* Get the size of the video with the tracks information of the media. */
-    libvlc_media_track_info_t *tracks;
+    libvlc_media_track_t **tracks;
     libvlc_media_parse(m);
-    int nbTracks = libvlc_media_get_tracks_info(m, &tracks);
+    int nbTracks = libvlc_media_tracks_get(m, &tracks);
     libvlc_media_release(m);
 
     /* Parse the results */
     unsigned videoWidth = 0, videoHeight = 0;
     bool hasVideoTrack = false;
     for (unsigned i = 0; i < nbTracks; ++i)
-        if (tracks[i].i_type == libvlc_track_video)
+        if (tracks[i]->i_type == libvlc_track_video)
         {
-            videoWidth = tracks[i].u.video.i_width;
-            videoHeight = tracks[i].u.video.i_height;
+            videoWidth = tracks[i]->video->i_width;
+            videoHeight = tracks[i]->video->i_height;
             hasVideoTrack = true;
             break;
         }
 
-    free(tracks);
+    libvlc_media_tracks_release(tracks, nbTracks);
 
     /* Abort if we have not found a video track. */
     if (!hasVideoTrack)



More information about the Android mailing list