[vlc-commits] VLCInputManager: use SEC_FROM_VLC_TICK() to convert from ticks

Steve Lhomme git at videolan.org
Fri Jul 6 12:42:15 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jul  6 12:06:47 2018 +0200| [62258ed6b1d26f40847bce2aeb6b92f13662a0d9] | committer: Steve Lhomme

VLCInputManager: use SEC_FROM_VLC_TICK() to convert from ticks

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

 modules/gui/macosx/VLCInputManager.m | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/VLCInputManager.m b/modules/gui/macosx/VLCInputManager.m
index fb68f37f77..0fce87b2be 100644
--- a/modules/gui/macosx/VLCInputManager.m
+++ b/modules/gui/macosx/VLCInputManager.m
@@ -541,7 +541,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
 
     NSMutableDictionary *currentlyPlayingTrackInfo = [NSMutableDictionary dictionary];
 
-    currentlyPlayingTrackInfo[MPMediaItemPropertyPlaybackDuration] = @(input_item_GetDuration(p_input_item) / CLOCK_FREQ);
+    currentlyPlayingTrackInfo[MPMediaItemPropertyPlaybackDuration] = @(SEC_FROM_VLC_TICK(input_item_GetDuration(p_input_item)));
     currentlyPlayingTrackInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = @(var_GetInteger(p_current_input, "time"));
     currentlyPlayingTrackInfo[MPNowPlayingInfoPropertyPlaybackRate] = @(var_GetFloat(p_current_input, "rate"));
 
@@ -708,8 +708,8 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
     NSMutableDictionary *mutDict = [[NSMutableDictionary alloc] initWithDictionary:[defaults objectForKey:@"recentlyPlayedMedia"]];
 
     float relativePos = var_GetFloat(p_input_thread, "position");
-    vlc_tick_t pos = var_GetInteger(p_input_thread, "time") / CLOCK_FREQ;
-    vlc_tick_t dur = input_item_GetDuration(p_item) / CLOCK_FREQ;
+    int pos = SEC_FROM_VLC_TICK(var_GetInteger(p_input_thread, "time"));
+    int dur = SEC_FROM_VLC_TICK(input_item_GetDuration(p_item));
 
     NSMutableArray *mediaList = [[defaults objectForKey:@"recentlyPlayedMediaList"] mutableCopy];
 



More information about the vlc-commits mailing list