Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
ad338835
Commit
ad338835
authored
Jan 16, 2010
by
Pierre
Browse files
macosx/framework: Duration is in millisecs, not in microsecs.
parent
a6b1ff10
Changes
2
Hide whitespace changes
Inline
Side-by-side
projects/macosx/framework/Sources/VLCMediaPlayer.m
View file @
ad338835
...
...
@@ -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
*
1000
000
;
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
*
1000
000
;
interval
=
interval
*
1000
;
[
self
setTime
:
[
VLCTime
timeWithInt
:
([[
self
time
]
intValue
]
+
interval
)]];
}
}
...
...
projects/macosx/framework/Sources/VLCTime.m
View file @
ad338835
...
...
@@ -96,7 +96,7 @@
{
if
(
value
)
{
long
long
duration
=
[
value
longLongValue
]
/
1000
000
;
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
]
/
1000
000
;
long
long
duration
=
[
value
longLongValue
]
/
1000
;
long
long
positiveDuration
=
llabs
(
duration
);
long
hours
=
positiveDuration
/
3600
;
long
mins
=
(
positiveDuration
/
60
)
%
60
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment