Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
16350c64
Commit
16350c64
authored
Dec 22, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/framework: Make sure remainingTime is KVO.
parent
549b9331
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
+1
-0
projects/macosx/framework/Sources/VLCMediaPlayer.m
projects/macosx/framework/Sources/VLCMediaPlayer.m
+7
-4
No files found.
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
View file @
16350c64
...
...
@@ -82,6 +82,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
void
*
instance
;
// Internal
VLCMedia
*
media
;
//< Current media being played
VLCTime
*
cachedTime
;
//< Cached time of the media being played
VLCTime
*
cachedRemainingTime
;
//< Cached remaining time of the media being played
VLCMediaPlayerState
cachedState
;
//< Cached state of the media being played
float
position
;
//< The position of the media being played
id
drawable
;
//< The drawable associated to this media player
...
...
projects/macosx/framework/Sources/VLCMediaPlayer.m
View file @
16350c64
...
...
@@ -223,6 +223,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
// Get rid of everything else
[
media
release
];
[
cachedTime
release
];
[
cachedRemainingTime
release
];
[
drawable
release
];
[
super
dealloc
];
...
...
@@ -462,9 +463,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
-
(
VLCTime
*
)
remainingTime
{
double
currentTime
=
[[
cachedTime
numberValue
]
doubleValue
];
double
remaining
=
currentTime
/
position
*
(
1
-
position
);
return
[
VLCTime
timeWithNumber
:[
NSNumber
numberWithDouble
:
-
remaining
]];
return
cachedRemainingTime
;
}
-
(
int
)
fps
...
...
@@ -875,6 +874,7 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
delegate
=
nil
;
media
=
nil
;
cachedTime
=
[[
VLCTime
nullTime
]
retain
];
cachedRemainingTime
=
[[
VLCTime
nullTime
]
retain
];
position
=
0
.
0
f
;
cachedState
=
VLCMediaPlayerStateStopped
;
...
...
@@ -929,7 +929,10 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
[
self
willChangeValueForKey
:
@"remainingTime"
];
[
cachedTime
release
];
cachedTime
=
[[
VLCTime
timeWithNumber
:
newTime
]
retain
];
[
cachedRemainingTime
release
];
double
currentTime
=
[[
cachedTime
numberValue
]
doubleValue
];
double
remaining
=
currentTime
/
position
*
(
1
-
position
);
cachedRemainingTime
=
[[
VLCTime
timeWithNumber
:[
NSNumber
numberWithDouble
:
-
remaining
]]
retain
];
[
self
didChangeValueForKey
:
@"remainingTime"
];
[
self
didChangeValueForKey
:
@"time"
];
}
...
...
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