Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
bfc6b198
Commit
bfc6b198
authored
Dec 11, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/framework: Don't automatically fetch meta, only when asked.
This saves some precious memory if we don't browse them.
parent
5216a752
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
projects/macosx/framework/Headers/Public/VLCMedia.h
projects/macosx/framework/Headers/Public/VLCMedia.h
+2
-1
projects/macosx/framework/Sources/VLCMedia.m
projects/macosx/framework/Sources/VLCMedia.m
+10
-8
No files found.
projects/macosx/framework/Headers/Public/VLCMedia.h
View file @
bfc6b198
...
...
@@ -113,7 +113,8 @@ typedef enum VLCMediaState
VLCTime
*
length
;
//< Cached duration of the media
NSMutableDictionary
*
metaDictionary
;
//< Meta data storage
id
delegate
;
//< Delegate object
BOOL
artFetched
;
//< Value used to determine of the artwork has been preparsed
BOOL
isArtFetched
;
//< Value used to determine of the artwork has been preparsed
BOOL
areOthersMetaFetched
;
//< Value used to determine of the other meta has been preparsed
VLCMediaState
state
;
//< Current state of the media
}
...
...
projects/macosx/framework/Sources/VLCMedia.m
View file @
bfc6b198
...
...
@@ -428,8 +428,6 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
artFetched
=
NO
;
char
*
p_url
=
libvlc_media_get_mrl
(
p_md
);
url
=
[[
NSURL
URLWithString
:[
NSString
stringWithUTF8String
:
p_url
]]
retain
];
...
...
@@ -456,10 +454,6 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
}
state
=
LibVLCStateToMediaState
(
libvlc_media_get_state
(
p_md
));
/* Force VLCMetaInformationTitle, that will trigger preparsing
* And all the other meta will be added through the libvlc event system */
[
self
fetchMetaInformationFromLibVLCWithType
:
VLCMetaInformationTitle
];
}
-
(
void
)
fetchMetaInformationFromLibVLCWithType
:(
NSString
*
)
metaType
...
...
@@ -542,12 +536,20 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
-
(
id
)
valueForKeyPath
:(
NSString
*
)
keyPath
{
if
(
!
a
rtFetched
&&
[
keyPath
isEqualToString
:
@"metaDictionary.artwork"
])
if
(
!
isA
rtFetched
&&
[
keyPath
isEqualToString
:
@"metaDictionary.artwork"
])
{
a
rtFetched
=
YES
;
isA
rtFetched
=
YES
;
/* Force the retrieval of the artwork now that someone asked for it */
[
self
fetchMetaInformationFromLibVLCWithType
:
VLCMetaInformationArtworkURL
];
}
else
if
(
!
areOthersMetaFetched
&&
[
keyPath
hasPrefix
:
@"metaDictionary."
])
{
areOthersMetaFetched
=
YES
;
/* Force VLCMetaInformationTitle, that will trigger preparsing
* And all the other meta will be added through the libvlc event system */
[
self
fetchMetaInformationFromLibVLCWithType
:
VLCMetaInformationTitle
];
}
return
[
super
valueForKeyPath
:
keyPath
];
}
@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