[vlc-devel] commit: Have (and document) libvlc_media_get_duration return ms ( Olivier Aubert )

git version control git at videolan.org
Tue Aug 4 17:17:10 CEST 2009


vlc | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Tue Aug  4 16:53:42 2009 +0200| [bb830b765ee9acad66884c6f23f908b2cafef252] | committer: Olivier Aubert 

Have (and document) libvlc_media_get_duration return ms

in order to be consistent with other libvlc methods (libvlc_media_player_get_length, get_time, ...)

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

 include/vlc/libvlc_media.h |    2 +-
 src/control/media.c        |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
index e21dca2..3d1743f 100644
--- a/include/vlc/libvlc_media.h
+++ b/include/vlc/libvlc_media.h
@@ -263,7 +263,7 @@ VLC_PUBLIC_API libvlc_event_manager_t *
                                            libvlc_exception_t * p_e );
 
 /**
- * Get duration of media descriptor object item.
+ * Get duration (in ms) of media descriptor object item.
  *
  * \param p_md media descriptor object
  * \param p_e an initialized exception object
diff --git a/src/control/media.c b/src/control/media.c
index aaf6a37..6f853f8 100644
--- a/src/control/media.c
+++ b/src/control/media.c
@@ -535,7 +535,7 @@ libvlc_media_event_manager( libvlc_media_t * p_md,
 }
 
 /**************************************************************************
- * Get duration of media object.
+ * Get duration of media object (in ms)
  **************************************************************************/
 int64_t
 libvlc_media_get_duration( libvlc_media_t * p_md,
@@ -549,7 +549,7 @@ libvlc_media_get_duration( libvlc_media_t * p_md,
         return -1;
     }
 
-    return input_item_GetDuration( p_md->p_input_item );
+    return input_item_GetDuration( p_md->p_input_item ) / 1000;
 }
 
 /**************************************************************************




More information about the vlc-devel mailing list