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
471ffd34
Commit
471ffd34
authored
Aug 24, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MKV: support target Type for metadata
This allows to differentiate Title and Album, for example
parent
9e62f5f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
20 deletions
+39
-20
modules/demux/mkv/matroska_segment.cpp
modules/demux/mkv/matroska_segment.cpp
+38
-19
modules/demux/mkv/matroska_segment.hpp
modules/demux/mkv/matroska_segment.hpp
+1
-1
No files found.
modules/demux/mkv/matroska_segment.cpp
View file @
471ffd34
...
...
@@ -221,23 +221,25 @@ void matroska_segment_c::LoadCues( KaxCues *cues )
static
const
struct
{
vlc_meta_type_t
type
;
const
char
*
key
;
}
metadata_map
[]
=
{
{
vlc_meta_Title
,
"TITLE"
},
{
vlc_meta_Artist
,
"ARTIST"
},
{
vlc_meta_Genre
,
"GENRE"
},
{
vlc_meta_Copyright
,
"COPYRIGHT"
},
{
vlc_meta_TrackNumber
,
"PART_NUMBER"
},
{
vlc_meta_Description
,
"DESCRIPTION"
},
{
vlc_meta_Description
,
"COMMENT"
},
{
vlc_meta_Rating
,
"RATING"
},
{
vlc_meta_Date
,
"DATE_RELEASED"
},
{
vlc_meta_URL
,
"URL"
},
{
vlc_meta_Publisher
,
"PUBLISHER"
},
{
vlc_meta_EncodedBy
,
"ENCODED_BY"
},
{
vlc_meta_TrackTotal
,
"TOTAL_PARTS"
},
{
vlc_meta_Title
,
NULL
},
int
target_type
;
/* 0 is valid for all target_type */
}
metadata_map
[]
=
{
{
vlc_meta_Title
,
"TITLE"
,
50
},
{
vlc_meta_Album
,
"TITLE"
,
30
},
{
vlc_meta_Artist
,
"ARTIST"
,
0
},
{
vlc_meta_Genre
,
"GENRE"
,
0
},
{
vlc_meta_Copyright
,
"COPYRIGHT"
,
0
},
{
vlc_meta_TrackNumber
,
"PART_NUMBER"
,
0
},
{
vlc_meta_Description
,
"DESCRIPTION"
,
0
},
{
vlc_meta_Description
,
"COMMENT"
,
0
},
{
vlc_meta_Rating
,
"RATING"
,
0
},
{
vlc_meta_Date
,
"DATE_RELEASED"
,
0
},
{
vlc_meta_URL
,
"URL"
,
0
},
{
vlc_meta_Publisher
,
"PUBLISHER"
,
0
},
{
vlc_meta_EncodedBy
,
"ENCODED_BY"
,
0
},
{
vlc_meta_TrackTotal
,
"TOTAL_PARTS"
,
0
},
{
vlc_meta_Title
,
NULL
,
0
},
};
void
matroska_segment_c
::
ParseSimpleTags
(
KaxTagSimple
*
tag
)
void
matroska_segment_c
::
ParseSimpleTags
(
KaxTagSimple
*
tag
,
int
target_type
)
{
EbmlElement
*
el
;
EbmlParser
*
ep
=
new
EbmlParser
(
&
es
,
tag
,
&
sys
.
demuxer
);
...
...
@@ -272,7 +274,8 @@ void matroska_segment_c::ParseSimpleTags( KaxTagSimple *tag )
for
(
int
i
=
0
;
metadata_map
[
i
].
key
;
i
++
)
{
if
(
!
strcmp
(
k
,
metadata_map
[
i
].
key
)
)
if
(
!
strcmp
(
k
,
metadata_map
[
i
].
key
)
&&
(
metadata_map
[
i
].
target_type
==
0
||
target_type
==
metadata_map
[
i
].
target_type
)
)
{
vlc_meta_Set
(
sys
.
meta
,
metadata_map
[
i
].
type
,
v
);
msg_Dbg
(
&
sys
.
demuxer
,
"| | + Meta %s: %s"
,
k
,
v
);
...
...
@@ -310,10 +313,28 @@ void matroska_segment_c::LoadTags( KaxTags *tags )
{
msg_Dbg
(
&
sys
.
demuxer
,
"+ Tag"
);
ep
->
Down
();
int
target_type
=
50
;
while
(
(
el
=
ep
->
Get
()
)
!=
NULL
)
{
if
(
MKV_IS_ID
(
el
,
KaxTagTargets
)
)
PARSE_TAG
(
"Targets"
);
{
msg_Dbg
(
&
sys
.
demuxer
,
"| + Targets"
);
ep
->
Down
();
while
(
(
el
=
ep
->
Get
()
)
!=
NULL
)
{
if
(
MKV_IS_ID
(
el
,
KaxTagTargetTypeValue
)
)
{
KaxTagTargetTypeValue
&
value
=
*
(
KaxTagTargetTypeValue
*
)
el
;
value
.
ReadData
(
es
.
I_O
()
);
msg_Dbg
(
&
sys
.
demuxer
,
"| | + TargetTypeValue: %u"
,
uint32
(
value
));
target_type
=
uint32
(
value
);
}
}
ep
->
Up
();
}
else
if
(
MKV_IS_ID
(
el
,
KaxTagSimple
)
)
ParseSimpleTags
(
static_cast
<
KaxTagSimple
*>
(
el
),
target_type
);
#if 0 // not valid anymore
else if( MKV_IS_ID( el, KaxTagGeneral ) )
PARSE_TAG( "General" );
...
...
@@ -352,8 +373,6 @@ void matroska_segment_c::LoadTags( KaxTags *tags )
msg_Dbg( &sys.demuxer, "| + Multi Title" );
}
#endif
else
if
(
MKV_IS_ID
(
el
,
KaxTagSimple
)
)
ParseSimpleTags
(
static_cast
<
KaxTagSimple
*>
(
el
)
);
else
{
msg_Dbg
(
&
sys
.
demuxer
,
"| + LoadTag Unknown (%s)"
,
typeid
(
*
el
).
name
()
);
...
...
modules/demux/mkv/matroska_segment.hpp
View file @
471ffd34
...
...
@@ -125,7 +125,7 @@ private:
void
ParseChapterAtom
(
int
i_level
,
KaxChapterAtom
*
ca
,
chapter_item_c
&
chapters
);
void
ParseTrackEntry
(
KaxTrackEntry
*
m
);
void
ParseCluster
(
bool
b_update_start_time
=
true
);
void
ParseSimpleTags
(
KaxTagSimple
*
tag
);
void
ParseSimpleTags
(
KaxTagSimple
*
tag
,
int
level
=
50
);
void
IndexAppendCluster
(
KaxCluster
*
cluster
);
};
...
...
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