Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
a4d92cb2
Commit
a4d92cb2
authored
Nov 21, 2006
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrects indentation
parent
d96a4490
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
41 deletions
+45
-41
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+45
-41
No files found.
modules/meta_engine/taglib.cpp
View file @
a4d92cb2
...
...
@@ -30,6 +30,7 @@
#include <id3v2tag.h>
#include <mpegfile.h>
#include <flacfile.h>
#include <vorbisfile.h>
#include <uniquefileidentifierframe.h>
#if 0 //for artist and album id
#include <textidentificationframe.h>
...
...
@@ -108,51 +109,54 @@ static int ReadMeta( vlc_object_t *p_this )
// SET( Tracknum , track ); Same
#undef SET
if
(
TagLib
::
MPEG
::
File
*
p_mpeg
=
dynamic_cast
<
TagLib
::
MPEG
::
File
*>
(
f
.
file
()
)
)
{
if
(
p_mpeg
->
ID3v2Tag
()
)
{
TagLib
::
ID3v2
::
Tag
*
tag
=
p_mpeg
->
ID3v2Tag
();
TagLib
::
ID3v2
::
FrameList
list
=
tag
->
frameListMap
()[
"UFID"
];
TagLib
::
ID3v2
::
UniqueFileIdentifierFrame
*
p_ufid
;
for
(
TagLib
::
ID3v2
::
FrameList
::
Iterator
iter
=
list
.
begin
();
iter
!=
list
.
end
();
iter
++
)
if
(
TagLib
::
MPEG
::
File
*
p_mpeg
=
dynamic_cast
<
TagLib
::
MPEG
::
File
*>
(
f
.
file
()
)
)
{
p_ufid
=
dynamic_cast
<
TagLib
::
ID3v2
::
UniqueFileIdentifierFrame
*>
(
*
iter
);
const
char
*
owner
=
p_ufid
->
owner
().
toCString
();
if
(
!
strcmp
(
owner
,
"http://musicbrainz.org"
))
if
(
p_mpeg
->
ID3v2Tag
()
)
{
/* ID3v2 UFID contains up to 64 bytes binary data
* but in our case it will be a '\0' terminated string */
char
*
psz_ufid
=
(
char
*
)
malloc
(
64
);
int
j
=
0
;
while
(
(
j
<
63
)
&&
(
j
<
p_ufid
->
identifier
().
size
()
)
)
psz_ufid
[
j
]
=
p_ufid
->
identifier
()[
j
++
];
psz_ufid
[
j
]
=
'\0'
;
vlc_meta_SetTrackID
(
p_meta
,
psz_ufid
);
free
(
psz_ufid
);
}
}
/* musicbrainz artist and album id: not useful yet */
TagLib
::
ID3v2
::
Tag
*
tag
=
p_mpeg
->
ID3v2Tag
();
TagLib
::
ID3v2
::
FrameList
list
=
tag
->
frameListMap
()[
"UFID"
];
TagLib
::
ID3v2
::
UniqueFileIdentifierFrame
*
p_ufid
;
for
(
TagLib
::
ID3v2
::
FrameList
::
Iterator
iter
=
list
.
begin
();
iter
!=
list
.
end
();
iter
++
)
{
p_ufid
=
dynamic_cast
<
TagLib
::
ID3v2
::
UniqueFileIdentifierFrame
*>
(
*
iter
);
const
char
*
owner
=
p_ufid
->
owner
().
toCString
();
if
(
!
strcmp
(
owner
,
"http://musicbrainz.org"
))
{
/* ID3v2 UFID contains up to 64 bytes binary data
* but in our case it will be a '\0'
* terminated string */
char
*
psz_ufid
=
(
char
*
)
malloc
(
64
);
int
j
=
0
;
while
(
(
j
<
63
)
&&
(
j
<
p_ufid
->
identifier
().
size
()
)
)
psz_ufid
[
j
]
=
p_ufid
->
identifier
()[
j
++
];
psz_ufid
[
j
]
=
'\0'
;
vlc_meta_SetTrackID
(
p_meta
,
psz_ufid
);
free
(
psz_ufid
);
}
}
/* musicbrainz artist and album id: not useful yet */
#if 0
list = tag->frameListMap()["TXXX"];
TagLib::ID3v2::UserTextIdentificationFrame* p_txxx;
for( TagLib::ID3v2::FrameList::Iterator iter = list.begin();
iter != list.end(); iter++ )
{
p_txxx = dynamic_cast<TagLib::ID3v2::UserTextIdentificationFrame*>(*iter);
const char *psz_desc
= p_txxx->description().toCString();
if( !strncmp( psz_desc, "MusicBrainz Artist Id", 21 ) )
vlc_meta_SetArtistID( p_meta,
p_txxx->fieldList().toString().toCString()
);
if( !strncmp( psz_desc, "MusicBrainz Album Id", 20 ) )
vlc_meta_SetAlbumID( p_meta,
p_txxx->fieldList().toString().toCString()
);
}
list = tag->frameListMap()["TXXX"];
TagLib::ID3v2::UserTextIdentificationFrame* p_txxx;
for( TagLib::ID3v2::FrameList::Iterator iter = list.begin();
iter != list.end(); iter++ )
{
p_txxx = dynamic_cast<TagLib::ID3v2::UserTextIdentificationFrame*>(*iter);
const char *psz_desc
= p_txxx->description().toCString();
if( !strncmp( psz_desc, "MusicBrainz Artist Id", 21 ) )
vlc_meta_SetArtistID( p_meta,
p_txxx->fieldList().toString().toCString()
);
if( !strncmp( psz_desc, "MusicBrainz Album Id", 20 ) )
vlc_meta_SetAlbumID( p_meta,
p_txxx->fieldList().toString().toCString()
);
}
#endif
}
}
}
}
DetectImage
(
f
,
p_meta
);
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