[vlc-devel] commit: mediacontrol_core: libvlc_media_player_get_length/ time return time in ms, no need for conversion. (Olivier Aubert )

git version control git at videolan.org
Fri Aug 8 19:03:46 CEST 2008


vlc | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Fri Aug  8 18:45:42 2008 +0200| [39a529ac7b74bcc20bedc274346baba6ac6330a4] | committer: Olivier Aubert 

mediacontrol_core: libvlc_media_player_get_length/time return time in ms, no need for conversion.
Additionnaly, add check for exception.

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

 src/control/mediacontrol_core.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/control/mediacontrol_core.c b/src/control/mediacontrol_core.c
index 8ed878b..997f412 100644
--- a/src/control/mediacontrol_core.c
+++ b/src/control/mediacontrol_core.c
@@ -397,18 +397,21 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
         }
 
         retval->url = libvlc_media_get_mrl( p_media, &ex );
-
-        /* TIME and LENGTH are in microseconds. We want them in ms */
+	
         retval->position = libvlc_media_player_get_time( self->p_media_player, &ex );
+        if( libvlc_exception_raised( &ex ) )
+        {
+            libvlc_exception_clear( &ex );
+            retval->position = 0;
+        }
 
         retval->length = libvlc_media_player_get_length( self->p_media_player, &ex );
+        if( libvlc_exception_raised( &ex ) )
+        {
+            libvlc_exception_clear( &ex );
+            retval->length = 0;
+        }
 
-        retval->position = private_mediacontrol_unit_convert( self->p_media_player,
-                                         mediacontrol_MediaTime, a_key,
-                                         retval->position );
-        retval->length   = private_mediacontrol_unit_convert( self->p_media_player,
-                                         mediacontrol_MediaTime, a_key,
-                                         retval->length );
     }
     return retval;
 }




More information about the vlc-devel mailing list