Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
5aa0d7fd
Commit
5aa0d7fd
authored
Jan 16, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/framework: handle duration changed events.
parent
79fc5b94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
15 deletions
+19
-15
projects/macosx/framework/Sources/VLCMedia.m
projects/macosx/framework/Sources/VLCMedia.m
+19
-15
No files found.
projects/macosx/framework/Sources/VLCMedia.m
View file @
5aa0d7fd
...
...
@@ -118,21 +118,21 @@ static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self)
[
pool
release
];
}
//
static void HandleMediaDurationChanged(const libvlc_event_t * event, void * self)
//
{
//
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
//
//
[[VLCEventManager sharedManager] callOnMainThreadObject:self
//
withMethod:@selector(setLength:)
//
withArgumentAsObject:[VLCTime timeWithNumber:
//
[NSNumber numberWithLongLong:event->u.media_duration_changed.new_duration]]];
//
[pool release];
//
}
static
void
HandleMediaDurationChanged
(
const
libvlc_event_t
*
event
,
void
*
self
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
[[
VLCEventManager
sharedManager
]
callOnMainThreadObject
:
self
withMethod:
@selector
(
setLength
:)
withArgumentAsObject:
[
VLCTime
timeWithNumber
:
[
NSNumber
numberWithLongLong
:
event
->
u
.
media_duration_changed
.
new_duration
]]];
[
pool
release
];
}
static
void
HandleMediaStateChanged
(
const
libvlc_event_t
*
event
,
void
*
self
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
[[
VLCEventManager
sharedManager
]
callOnMainThreadObject
:
self
withMethod:
@selector
(
setStateAsNumber
:)
withArgumentAsObject:
[
NSNumber
numberWithInt
:
...
...
@@ -232,7 +232,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
* Before libvlc_event_detach. So this can't happen in dealloc */
libvlc_event_manager_t
*
p_em
=
libvlc_media_event_manager
(
p_md
);
libvlc_event_detach
(
p_em
,
libvlc_MediaMetaChanged
,
HandleMediaMetaChanged
,
self
,
NULL
);
//
libvlc_event_detach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self, NULL);
libvlc_event_detach
(
p_em
,
libvlc_MediaDurationChanged
,
HandleMediaDurationChanged
,
self
,
NULL
);
libvlc_event_detach
(
p_em
,
libvlc_MediaStateChanged
,
HandleMediaStateChanged
,
self
,
NULL
);
libvlc_event_detach
(
p_em
,
libvlc_MediaSubItemAdded
,
HandleMediaSubItemAdded
,
self
,
NULL
);
}
...
...
@@ -295,11 +295,15 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
if
(
!
length
)
{
// Force preparsing of this item.
[
self
length
];
// wait until we are preparsed
while
(
!
length
&&
!
[
self
isPreparsed
]
&&
[
aDate
timeIntervalSinceNow
]
>
0
)
{
usleep
(
thread_sleep
);
}
// So we're done waiting, but sometimes we trap the fact that the parsing
// was done before the length gets assigned, so lets go ahead and assign
// it ourselves.
...
...
@@ -440,10 +444,10 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
libvlc_event_manager_t
*
p_em
=
libvlc_media_event_manager
(
p_md
);
libvlc_event_attach
(
p_em
,
libvlc_MediaMetaChanged
,
HandleMediaMetaChanged
,
self
,
&
ex
);
//
libvlc_event_attach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self, &ex);
libvlc_event_attach
(
p_em
,
libvlc_MediaDurationChanged
,
HandleMediaDurationChanged
,
self
,
&
ex
);
libvlc_event_attach
(
p_em
,
libvlc_MediaStateChanged
,
HandleMediaStateChanged
,
self
,
&
ex
);
libvlc_event_attach
(
p_em
,
libvlc_MediaSubItemAdded
,
HandleMediaSubItemAdded
,
self
,
&
ex
);
libvlc_media_list_t
*
p_mlist
=
libvlc_media_subitems
(
p_md
);
if
(
!
p_mlist
)
...
...
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