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
c8407ec6
Commit
c8407ec6
authored
Jan 17, 2014
by
Wieland Hoffmann
Committed by
Jean-Baptiste Kempf
Feb 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
meta_engine/taglib: Write MusicBrainz Track IDs
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
922c1bc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
29 deletions
+35
-29
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+35
-29
No files found.
modules/meta_engine/taglib.cpp
View file @
c8407ec6
...
...
@@ -793,7 +793,7 @@ static void WriteMetaToAPE( APE::Tag* tag, input_item_t* p_item )
WRITE
(
Copyright
,
"COPYRIGHT"
);
WRITE
(
Language
,
"LANGUAGE"
);
WRITE
(
Publisher
,
"PUBLISHER"
);
WRITE
(
TrackID
,
"MUSICBRAINZ_TRACKID"
);
#undef WRITE
}
...
...
@@ -825,35 +825,41 @@ static void WriteMetaToId3v2( ID3v2::Tag* tag, input_item_t* p_item )
WRITE
(
Publisher
,
"TPUB"
);
#undef WRITE
/* Track Total as Custom Field */
psz_meta
=
input_item_GetTrackTotal
(
p_item
);
if
(
psz_meta
)
{
ID3v2
::
FrameList
list
=
tag
->
frameListMap
()[
"TXXX"
];
ID3v2
::
UserTextIdentificationFrame
*
p_txxx
;
for
(
ID3v2
::
FrameList
::
Iterator
iter
=
list
.
begin
();
iter
!=
list
.
end
();
iter
++
)
{
p_txxx
=
dynamic_cast
<
ID3v2
::
UserTextIdentificationFrame
*>
(
*
iter
);
if
(
!
p_txxx
)
continue
;
if
(
!
strcmp
(
p_txxx
->
description
().
toCString
(
true
),
"TRACKTOTAL"
)
)
{
p_txxx
->
setText
(
psz_meta
);
FREENULL
(
psz_meta
);
break
;
}
}
if
(
psz_meta
)
/* not found in existing custom fields */
{
ByteVector
p_byte
(
"TXXX"
,
4
);
p_txxx
=
new
ID3v2
::
UserTextIdentificationFrame
(
p_byte
);
p_txxx
->
setDescription
(
"TRACKTOTAL"
);
p_txxx
->
setText
(
psz_meta
);
free
(
psz_meta
);
tag
->
addFrame
(
p_txxx
);
}
/* Known TXXX frames */
ID3v2
::
FrameList
list
=
tag
->
frameListMap
()[
"TXXX"
];
#define WRITETXXX( metaName, txxName )\
psz_meta = input_item_Get##metaName( p_item ); \
if ( psz_meta ) \
{ \
ID3v2::UserTextIdentificationFrame *p_txxx; \
for( ID3v2::FrameList::Iterator iter = list.begin(); iter != list.end(); iter++ )\
{ \
p_txxx = dynamic_cast<ID3v2::UserTextIdentificationFrame*>(*iter); \
if( !p_txxx ) \
continue; \
if( !strcmp( p_txxx->description().toCString( true ), txxName ) ) \
{ \
p_txxx->setText( psz_meta ); \
FREENULL( psz_meta ); \
break; \
} \
} \
if( psz_meta )
/* not found in existing custom fields */
\
{ \
ByteVector p_byte( "TXXX", 4 ); \
p_txxx = new ID3v2::UserTextIdentificationFrame( p_byte ); \
p_txxx->setDescription( txxName ); \
p_txxx->setText( psz_meta ); \
free( psz_meta ); \
tag->addFrame( p_txxx ); \
} \
}
WRITETXXX
(
TrackTotal
,
"TRACKTOTAL"
);
#undef WRITETXXX
/* Write album art */
char
*
psz_url
=
input_item_GetArtworkURL
(
p_item
);
if
(
psz_url
==
NULL
)
...
...
@@ -952,7 +958,7 @@ static void WriteMetaToXiph( Ogg::XiphComment* tag, input_item_t* p_item )
WRITE
(
EncodedBy
,
"ENCODER"
);
WRITE
(
Rating
,
"RATING"
);
WRITE
(
Language
,
"LANGUAGE"
);
WRITE
(
TrackID
,
"MUSICBRAINZ_TRACKID"
);
#undef WRITE
}
...
...
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