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
1c45e0b2
Commit
1c45e0b2
authored
Dec 12, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/Framework/VLCMedia.m: Speed a bit stringToMetaType.
parent
8b583911
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
21 deletions
+29
-21
extras/MacOSX/Framework/Sources/VLCMedia.m
extras/MacOSX/Framework/Sources/VLCMedia.m
+29
-21
No files found.
extras/MacOSX/Framework/Sources/VLCMedia.m
View file @
1c45e0b2
...
...
@@ -296,27 +296,37 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
* Implementation VLCMedia (Private)
*/
@implementation
VLCMedia
(
Private
)
+
(
libvlc_meta_t
)
stringToMetaType
:(
NSString
*
)
string
{
#define VLCStringToMeta( name, string ) if ([VLCMetaInformation##name compare:string] == NSOrderedSame) return libvlc_meta_##name;
VLCStringToMeta
(
Title
,
string
);
VLCStringToMeta
(
Artist
,
string
);
VLCStringToMeta
(
Genre
,
string
);
VLCStringToMeta
(
Copyright
,
string
);
VLCStringToMeta
(
Album
,
string
);
VLCStringToMeta
(
TrackNumber
,
string
);
VLCStringToMeta
(
Description
,
string
);
VLCStringToMeta
(
Rating
,
string
);
VLCStringToMeta
(
Date
,
string
);
VLCStringToMeta
(
Setting
,
string
);
VLCStringToMeta
(
URL
,
string
);
VLCStringToMeta
(
Language
,
string
);
VLCStringToMeta
(
NowPlaying
,
string
);
VLCStringToMeta
(
Publisher
,
string
);
VLCStringToMeta
(
ArtworkURL
,
string
);
VLCStringToMeta
(
TrackID
,
string
);
static
NSDictionary
*
stringToMetaDictionary
=
nil
;
// TODO: Thread safe-ize
if
(
!
stringToMetaDictionary
)
{
#define VLCStringToMeta( name ) [NSNumber numberWithInt: libvlc_meta_##name], VLCMetaInformation##name
stringToMetaDictionary
=
[[
NSDictionary
dictionaryWithObjectsAndKeys
:
VLCStringToMeta
(
Title
),
VLCStringToMeta
(
Artist
),
VLCStringToMeta
(
Genre
),
VLCStringToMeta
(
Copyright
),
VLCStringToMeta
(
Album
),
VLCStringToMeta
(
TrackNumber
),
VLCStringToMeta
(
Description
),
VLCStringToMeta
(
Rating
),
VLCStringToMeta
(
Date
),
VLCStringToMeta
(
Setting
),
VLCStringToMeta
(
URL
),
VLCStringToMeta
(
Language
),
VLCStringToMeta
(
NowPlaying
),
VLCStringToMeta
(
Publisher
),
VLCStringToMeta
(
ArtworkURL
),
VLCStringToMeta
(
TrackID
),
nil
]
retain
];
#undef VLCStringToMeta
return
-
1
;
}
NSNumber
*
number
=
[
stringToMetaDictionary
objectForKey
:
string
];
return
number
?
[
number
intValue
]
:
-
1
;
}
+
(
NSString
*
)
metaTypeToString
:(
libvlc_meta_t
)
type
...
...
@@ -387,9 +397,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
return
;
}
@synchronized
(
metaDictionary
)
{
[
metaDictionary
setValue
:
newValue
forKeyPath
:
metaType
];
}
[
metaDictionary
setValue
:
newValue
forKeyPath
:
metaType
];
}
}
...
...
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