[vlc-commits] libvlc_media_tracks_get: use unsigned as applicable

Rémi Denis-Courmont git at videolan.org
Tue Feb 12 21:53:33 CET 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Feb 12 22:52:48 2013 +0200| [59a6c9693c2064f3341ed04d933d2b6a38fb99e7] | committer: Rémi Denis-Courmont

libvlc_media_tracks_get: use unsigned as applicable

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

 include/vlc/libvlc_media.h |    8 ++++----
 lib/media.c                |    8 +++-----
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
index 92016b7..5e4482f 100644
--- a/include/vlc/libvlc_media.h
+++ b/include/vlc/libvlc_media.h
@@ -575,11 +575,11 @@ int libvlc_media_get_tracks_info( libvlc_media_t *p_md,
  *        descriptions (must be freed with libvlc_media_tracks_release
           by the caller) [OUT]
  *
- * \return the number of Elementary Streams
+ * \return the number of Elementary Streams (zero on error)
  */
 LIBVLC_API
-int libvlc_media_tracks_get( libvlc_media_t *p_md,
-                             libvlc_media_track_t ***tracks );
+unsigned libvlc_media_tracks_get( libvlc_media_t *p_md,
+                                  libvlc_media_track_t ***tracks );
 
 
 /**
@@ -592,7 +592,7 @@ int libvlc_media_tracks_get( libvlc_media_t *p_md,
  */
 LIBVLC_API
 void libvlc_media_tracks_release( libvlc_media_track_t **p_tracks,
-                                  int i_count );
+                                  unsigned i_count );
 
 /** @}*/
 
diff --git a/lib/media.c b/lib/media.c
index d7d0872..120f0f4 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -735,7 +735,7 @@ libvlc_media_get_tracks_info( libvlc_media_t *p_md, libvlc_media_track_info_t **
     return i_es;
 }
 
-int
+unsigned
 libvlc_media_tracks_get( libvlc_media_t *p_md, libvlc_media_track_t *** pp_es )
 {
     assert( p_md );
@@ -819,11 +819,9 @@ libvlc_media_tracks_get( libvlc_media_t *p_md, libvlc_media_track_t *** pp_es )
 /**************************************************************************
  * Release media descriptor's elementary streams description array
  **************************************************************************/
-void libvlc_media_tracks_release( libvlc_media_track_t **p_tracks, int i_count )
+void libvlc_media_tracks_release( libvlc_media_track_t **p_tracks, unsigned i_count )
 {
-    if( !p_tracks )
-        return;
-    for( int i = 0; i < i_count; ++i )
+    for( unsigned i = 0; i < i_count; ++i )
     {
         if ( !p_tracks[i] )
             continue;



More information about the vlc-commits mailing list