From bb830b765ee9acad66884c6f23f908b2cafef252 Mon Sep 17 00:00:00 2001 From: Olivier Aubert Date: Tue, 4 Aug 2009 16:53:42 +0200 Subject: [PATCH] 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, ...) --- 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 e21dca2c14..3d1743f1ef 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 aaf6a37f55..6f853f8e62 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; } /************************************************************************** -- 2.39.2