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
81dc52be
Commit
81dc52be
authored
Jan 05, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/framework: Only create the NSImage corresponding to the artwork if asked.
parent
1d034f0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
projects/macosx/framework/Headers/Public/VLCMedia.h
projects/macosx/framework/Headers/Public/VLCMedia.h
+1
-0
projects/macosx/framework/Sources/VLCMedia.m
projects/macosx/framework/Sources/VLCMedia.m
+10
-3
No files found.
projects/macosx/framework/Headers/Public/VLCMedia.h
View file @
81dc52be
...
...
@@ -114,6 +114,7 @@ typedef enum VLCMediaState
id
delegate
;
//< Delegate object
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
BOOL
isArtURLFetched
;
//< 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 @
81dc52be
...
...
@@ -466,12 +466,12 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
if
(
newValue
!=
oldValue
&&
!
(
oldValue
&&
newValue
&&
[
oldValue
compare
:
newValue
]
==
NSOrderedSame
)
)
{
if
([
metaType
isEqualToString
:
VLCMetaInformationArtworkURL
])
// Only fetch the art if needed. (ie, create the NSImage, if it was requested before)
if
(
isArtFetched
&&
[
metaType
isEqualToString
:
VLCMetaInformationArtworkURL
])
{
[
NSThread
detachNewThreadSelector
:
@selector
(
fetchMetaInformationForArtWorkWithURL
:)
toTarget:
self
withObject:
newValue
];
return
;
}
[
metaDictionary
setValue
:
newValue
forKeyPath
:
metaType
];
...
...
@@ -550,7 +550,14 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
* And all the other meta will be added through the libvlc event system */
[
self
fetchMetaInformationFromLibVLCWithType
:
VLCMetaInformationTitle
];
}
else
if
(
!
isArtURLFetched
&&
[
keyPath
hasPrefix
:
@"metaDictionary.artworkURL"
])
{
isArtURLFetched
=
YES
;
/* Force isArtURLFetched, that will trigger artwork download eventually
* And all the other meta will be added through the libvlc event system */
[
self
fetchMetaInformationFromLibVLCWithType
:
VLCMetaInformationArtworkURL
];
}
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