[vlc-devel] commit: mediacontrol: libvlc_media_player_get_time/ get_length return times in ms (Olivier Aubert )

git version control git at videolan.org
Fri Aug 8 18:06:15 CEST 2008


vlc | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Fri Aug  8 18:04:37 2008 +0200| [a3452c51d623cfd464d9dedf211e540ff7d2e00a] | committer: Olivier Aubert 

mediacontrol: libvlc_media_player_get_time/get_length return times in ms

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

 src/control/mediacontrol_util.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/control/mediacontrol_util.c b/src/control/mediacontrol_util.c
index eb0fcff..e86646f 100644
--- a/src/control/mediacontrol_util.c
+++ b/src/control/mediacontrol_util.c
@@ -142,11 +142,11 @@ private_mediacontrol_position2microsecond( libvlc_media_player_t * p_media_playe
         l_time = libvlc_media_player_get_time( p_media_player, &ex );
         /* Ignore exception, we will assume a 0 time value */
 
-        l_pos = 1000 * private_mediacontrol_unit_convert( p_media_player,
-                                                          pos->key,
-                                                          mediacontrol_MediaTime,
-                                                          pos->value );
-        return l_time + l_pos;
+        l_pos = private_mediacontrol_unit_convert( p_media_player,
+						   pos->key,
+						   mediacontrol_MediaTime,
+						   pos->value );
+        return 1000 * ( l_time + l_pos );
         break;
     }
     case mediacontrol_ModuloPosition:
@@ -164,12 +164,12 @@ private_mediacontrol_position2microsecond( libvlc_media_player_t * p_media_playe
         l_time = libvlc_media_player_get_time( p_media_player, &ex );
         /* Ignore exception, we will assume a 0 time value */
 
-        l_pos = ( 1000 * private_mediacontrol_unit_convert( p_media_player,
-                                                            pos->key,
-                                                            mediacontrol_MediaTime,
-                                                            pos->value ) );
+        l_pos = private_mediacontrol_unit_convert( p_media_player,
+						   pos->key,
+						   mediacontrol_MediaTime,
+						   pos->value );
 
-        return ( l_time + l_pos ) % l_length;
+        return 1000 * ( ( l_time + l_pos ) % l_length );
         break;
     }
     }




More information about the vlc-devel mailing list