[vlc-commits] [Git][videolan/vlc][master] lib: Properly convert durations in milliseconds

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Sep 21 14:15:51 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
e8e27aaa by Diogo Simao Marques at 2024-09-21T14:01:29+00:00
lib: Properly convert durations in milliseconds

New durations set along with the media_duration_changed event are
now properly converted in milliseconds to match the unit described
in the documentation.

- - - - -


2 changed files:

- lib/media.c
- lib/media_player.c


Changes:

=====================================
lib/media.c
=====================================
@@ -280,7 +280,7 @@ static void send_parsed_changed( libvlc_media_t *p_md,
     /* Duration event */
     event.type = libvlc_MediaDurationChanged;
     event.u.media_duration_changed.new_duration =
-        input_item_GetDuration( p_md->p_input_item );
+        libvlc_time_from_vlc_tick(input_item_GetDuration( p_md->p_input_item ));
     libvlc_event_send( &p_md->event_manager, &event );
 
     /* Meta event */


=====================================
lib/media_player.c
=====================================
@@ -245,7 +245,7 @@ on_length_changed(vlc_player_t *player, vlc_tick_t new_length, void *data)
         /* Duration event */
         event.type = libvlc_MediaDurationChanged;
         event.u.media_duration_changed.new_duration =
-            input_item_GetDuration( md->p_input_item );
+            libvlc_time_from_vlc_tick(input_item_GetDuration( md->p_input_item ));
         libvlc_event_send( &md->event_manager, &event );
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e8e27aaa82b766e3ade1fa6a41de45983d5a301d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e8e27aaa82b766e3ade1fa6a41de45983d5a301d
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list