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
f77e83ab
Commit
f77e83ab
authored
Apr 07, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: refactor meta getter, fix title & language and add items
parent
1bcf73a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
18 deletions
+32
-18
modules/demux/avformat/demux.c
modules/demux/avformat/demux.c
+32
-18
No files found.
modules/demux/avformat/demux.c
View file @
f77e83ab
...
@@ -868,24 +868,38 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -868,24 +868,38 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_GET_META
:
case
DEMUX_GET_META
:
{
{
vlc_meta_t
*
p_meta
=
(
vlc_meta_t
*
)
va_arg
(
args
,
vlc_meta_t
*
);
static
const
char
names
[][
10
]
=
{
[
vlc_meta_Title
]
=
"title"
,
AVDictionaryEntry
*
title
=
av_dict_get
(
p_sys
->
ic
->
metadata
,
"language"
,
NULL
,
0
);
[
vlc_meta_Artist
]
=
"artist"
,
AVDictionaryEntry
*
artist
=
av_dict_get
(
p_sys
->
ic
->
metadata
,
"artist"
,
NULL
,
0
);
[
vlc_meta_Genre
]
=
"genre"
,
AVDictionaryEntry
*
copyright
=
av_dict_get
(
p_sys
->
ic
->
metadata
,
"copyright"
,
NULL
,
0
);
[
vlc_meta_Copyright
]
=
"copyright"
,
AVDictionaryEntry
*
comment
=
av_dict_get
(
p_sys
->
ic
->
metadata
,
"comment"
,
NULL
,
0
);
[
vlc_meta_Album
]
=
"album"
,
AVDictionaryEntry
*
genre
=
av_dict_get
(
p_sys
->
ic
->
metadata
,
"genre"
,
NULL
,
0
);
//[vlc_meta_TrackNumber] -- TODO: parse number/total value
[
vlc_meta_Description
]
=
"comment"
,
if
(
title
&&
title
->
value
)
//[vlc_meta_Rating]
vlc_meta_SetTitle
(
p_meta
,
title
->
value
);
[
vlc_meta_Date
]
=
"date"
,
if
(
artist
&&
artist
->
value
)
[
vlc_meta_Setting
]
=
"encoder"
,
vlc_meta_SetArtist
(
p_meta
,
artist
->
value
);
//[vlc_meta_URL]
if
(
copyright
&&
copyright
->
value
)
[
vlc_meta_Language
]
=
"language"
,
vlc_meta_SetCopyright
(
p_meta
,
copyright
->
value
);
//[vlc_meta_NowPlaying]
if
(
comment
&&
comment
->
value
)
[
vlc_meta_Publisher
]
=
"publisher"
,
vlc_meta_SetDescription
(
p_meta
,
comment
->
value
);
[
vlc_meta_EncodedBy
]
=
"encoded_by"
,
if
(
genre
&&
genre
->
value
)
//[vlc_meta_ArtworkURL]
vlc_meta_SetGenre
(
p_meta
,
genre
->
value
);
//[vlc_meta_TrackID]
//[vlc_meta_TrackTotal]
};
vlc_meta_t
*
p_meta
=
va_arg
(
args
,
vlc_meta_t
*
);
AVDictionary
*
dict
=
p_sys
->
ic
->
metadata
;
for
(
unsigned
i
=
0
;
i
<
sizeof
(
names
)
/
sizeof
(
*
names
);
i
++
)
{
if
(
!
names
[
i
][
0
]
)
continue
;
AVDictionaryEntry
*
e
=
av_dict_get
(
dict
,
names
[
i
],
NULL
,
0
);
if
(
e
!=
NULL
&&
e
->
value
!=
NULL
)
vlc_meta_Set
(
p_meta
,
i
,
e
->
value
);
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
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