Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
1b26ff77
Commit
1b26ff77
authored
Dec 30, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/Framework/VLCMedia.m: Update the subitems on sub item additions.
parent
0d4609bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
extras/MacOSX/Framework/Sources/VLCMedia.m
extras/MacOSX/Framework/Sources/VLCMedia.m
+28
-0
No files found.
extras/MacOSX/Framework/Sources/VLCMedia.m
View file @
1b26ff77
...
...
@@ -70,6 +70,7 @@ NSString *VLCMediaMetaChanged = @"VLCMediaMetaChanged";
/* Callback Methods */
-
(
void
)
metaChanged
:(
NSString
*
)
metaType
;
-
(
void
)
subItemAdded
;
@end
static
VLCMediaState
libvlc_state_to_media_state
[]
=
...
...
@@ -122,6 +123,15 @@ static void HandleMediaStateChanged(const libvlc_event_t *event, void *self)
[
pool
release
];
}
static
void
HandleMediaSubItemAdded
(
const
libvlc_event_t
*
event
,
void
*
self
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
[[
VLCEventManager
sharedManager
]
callOnMainThreadObject
:
self
withMethod:
@selector
(
subItemAdded
)
withArgumentAsObject:
nil
];
[
pool
release
];
}
/******************************************************************************
* Implementation
*/
...
...
@@ -206,6 +216,7 @@ static void HandleMediaStateChanged(const libvlc_event_t *event, void *self)
libvlc_event_detach
(
p_em
,
libvlc_MediaDescriptorMetaChanged
,
HandleMediaMetaChanged
,
self
,
NULL
);
libvlc_event_detach
(
p_em
,
libvlc_MediaDescriptorDurationChanged
,
HandleMediaDurationChanged
,
self
,
NULL
);
libvlc_event_detach
(
p_em
,
libvlc_MediaDescriptorStateChanged
,
HandleMediaStateChanged
,
self
,
NULL
);
libvlc_event_detach
(
p_em
,
libvlc_MediaDescriptorSubItemAdded
,
HandleMediaSubItemAdded
,
self
,
NULL
);
}
[
super
release
];
}
...
...
@@ -427,6 +438,7 @@ static void HandleMediaStateChanged(const libvlc_event_t *event, void *self)
libvlc_event_attach
(
p_em
,
libvlc_MediaDescriptorMetaChanged
,
HandleMediaMetaChanged
,
self
,
&
ex
);
libvlc_event_attach
(
p_em
,
libvlc_MediaDescriptorDurationChanged
,
HandleMediaDurationChanged
,
self
,
&
ex
);
libvlc_event_attach
(
p_em
,
libvlc_MediaDescriptorStateChanged
,
HandleMediaStateChanged
,
self
,
&
ex
);
libvlc_event_attach
(
p_em
,
libvlc_MediaDescriptorSubItemAdded
,
HandleMediaSubItemAdded
,
self
,
&
ex
);
quit_on_exception
(
&
ex
);
libvlc_media_list_t
*
p_mlist
=
libvlc_media_descriptor_subitems
(
p_md
,
NULL
);
...
...
@@ -438,6 +450,7 @@ static void HandleMediaStateChanged(const libvlc_event_t *event, void *self)
subitems
=
[[
VLCMediaList
mediaListWithLibVLCMediaList
:
p_mlist
]
retain
];
libvlc_media_list_release
(
p_mlist
);
}
state
=
LibVLCStateToMediaState
(
libvlc_media_descriptor_get_state
(
p_md
,
NULL
));
/* Force VLCMetaInformationTitle, that will trigger preparsing
* And all the other meta will be added through the libvlc event system */
...
...
@@ -489,6 +502,21 @@ static void HandleMediaStateChanged(const libvlc_event_t *event, void *self)
{
[
self
fetchMetaInformationFromLibVLCWithType
:
metaType
];
}
-
(
void
)
subItemAdded
{
if
(
subitems
)
return
;
/* Nothing to do */
libvlc_media_list_t
*
p_mlist
=
libvlc_media_descriptor_subitems
(
p_md
,
NULL
);
NSAssert
(
p_mlist
,
@"The mlist shouldn't be nil, we are receiving a subItemAdded"
);
[
self
willChangeValueForKey
:
@"subitems"
];
subitems
=
[[
VLCMediaList
mediaListWithLibVLCMediaList
:
p_mlist
]
retain
];
[
self
didChangeValueForKey
:
@"subitems"
];
libvlc_media_list_release
(
p_mlist
);
}
@end
/******************************************************************************
...
...
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