From ad338835352c1164e3f3ac2021413fa226071f34 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Sat, 16 Jan 2010 16:12:55 +0100 Subject: [PATCH] macosx/framework: Duration is in millisecs, not in microsecs. --- projects/macosx/framework/Sources/VLCMediaPlayer.m | 8 ++++---- projects/macosx/framework/Sources/VLCTime.m | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m index 3dac7ee258..bad64b8d05 100644 --- a/projects/macosx/framework/Sources/VLCMediaPlayer.m +++ b/projects/macosx/framework/Sources/VLCMediaPlayer.m @@ -450,8 +450,8 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s libvlc_exception_init( &ex ); // Time is managed in seconds, while duration is managed in microseconds // TODO: Redo VLCTime to provide value numberAsMilliseconds, numberAsMicroseconds, numberAsSeconds, numberAsMinutes, numberAsHours - libvlc_media_player_set_time( (libvlc_media_player_t *)instance, - (value ? [[value numberValue] longLongValue] / 1000 : 0), + libvlc_media_player_set_time( (libvlc_media_player_t *)instance, + (value ? [[value numberValue] longLongValue] : 0), &ex ); catch_exception( &ex ); } @@ -733,7 +733,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s { if( [self isSeekable] ) { - interval = interval * 1000000; + interval = interval * 1000; [self setTime: [VLCTime timeWithInt: ([[self time] intValue] - interval)]]; } } @@ -742,7 +742,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s { if( [self isSeekable] ) { - interval = interval * 1000000; + interval = interval * 1000; [self setTime: [VLCTime timeWithInt: ([[self time] intValue] + interval)]]; } } diff --git a/projects/macosx/framework/Sources/VLCTime.m b/projects/macosx/framework/Sources/VLCTime.m index fa4dc4e305..47c4b62231 100644 --- a/projects/macosx/framework/Sources/VLCTime.m +++ b/projects/macosx/framework/Sources/VLCTime.m @@ -96,7 +96,7 @@ { if (value) { - long long duration = [value longLongValue] / 1000000; + long long duration = [value longLongValue] / 1000; long long positiveDuration = llabs(duration); if( positiveDuration > 3600 ) return [NSString stringWithFormat:@"%s%01d:%02d:%02d", @@ -121,7 +121,7 @@ { if (value) { - long long duration = [value longLongValue] / 1000000; + long long duration = [value longLongValue] / 1000; long long positiveDuration = llabs(duration); long hours = positiveDuration / 3600; long mins = (positiveDuration / 60) % 60; -- 2.39.2