Commit a4d92cb2 authored by Rafaël Carré's avatar Rafaël Carré

Corrects indentation

parent d96a4490
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <id3v2tag.h> #include <id3v2tag.h>
#include <mpegfile.h> #include <mpegfile.h>
#include <flacfile.h> #include <flacfile.h>
#include <vorbisfile.h>
#include <uniquefileidentifierframe.h> #include <uniquefileidentifierframe.h>
#if 0 //for artist and album id #if 0 //for artist and album id
#include <textidentificationframe.h> #include <textidentificationframe.h>
...@@ -108,51 +109,54 @@ static int ReadMeta( vlc_object_t *p_this ) ...@@ -108,51 +109,54 @@ static int ReadMeta( vlc_object_t *p_this )
// SET( Tracknum , track ); Same // SET( Tracknum , track ); Same
#undef SET #undef SET
if( TagLib::MPEG::File *p_mpeg = if( TagLib::MPEG::File *p_mpeg =
dynamic_cast<TagLib::MPEG::File *>(f.file() ) ) 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++ )
{ {
p_ufid = dynamic_cast<TagLib::ID3v2::UniqueFileIdentifierFrame*>(*iter); if( p_mpeg->ID3v2Tag() )
const char *owner = p_ufid->owner().toCString();
if (!strcmp( owner, "http://musicbrainz.org" ))
{ {
/* ID3v2 UFID contains up to 64 bytes binary data TagLib::ID3v2::Tag *tag = p_mpeg->ID3v2Tag();
* but in our case it will be a '\0' terminated string */ TagLib::ID3v2::FrameList list = tag->frameListMap()["UFID"];
char *psz_ufid = (char*) malloc( 64 ); TagLib::ID3v2::UniqueFileIdentifierFrame* p_ufid;
int j = 0; for( TagLib::ID3v2::FrameList::Iterator iter = list.begin();
while( ( j < 63 ) && ( j < p_ufid->identifier().size() ) ) iter != list.end(); iter++ )
psz_ufid[j] = p_ufid->identifier()[j++]; {
psz_ufid[j] = '\0'; p_ufid = dynamic_cast<TagLib::ID3v2::UniqueFileIdentifierFrame*>(*iter);
vlc_meta_SetTrackID( p_meta, psz_ufid ); const char *owner = p_ufid->owner().toCString();
free( psz_ufid ); if (!strcmp( owner, "http://musicbrainz.org" ))
} {
} /* ID3v2 UFID contains up to 64 bytes binary data
/* musicbrainz artist and album id: not useful yet */ * 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 #if 0
list = tag->frameListMap()["TXXX"]; list = tag->frameListMap()["TXXX"];
TagLib::ID3v2::UserTextIdentificationFrame* p_txxx; TagLib::ID3v2::UserTextIdentificationFrame* p_txxx;
for( TagLib::ID3v2::FrameList::Iterator iter = list.begin(); for( TagLib::ID3v2::FrameList::Iterator iter = list.begin();
iter != list.end(); iter++ ) iter != list.end(); iter++ )
{ {
p_txxx = dynamic_cast<TagLib::ID3v2::UserTextIdentificationFrame*>(*iter); p_txxx = dynamic_cast<TagLib::ID3v2::UserTextIdentificationFrame*>(*iter);
const char *psz_desc = p_txxx->description().toCString(); const char *psz_desc= p_txxx->description().toCString();
if( !strncmp( psz_desc, "MusicBrainz Artist Id", 21 ) ) if( !strncmp( psz_desc, "MusicBrainz Artist Id", 21 ) )
vlc_meta_SetArtistID( p_meta, vlc_meta_SetArtistID( p_meta,
p_txxx->fieldList().toString().toCString() ); p_txxx->fieldList().toString().toCString());
if( !strncmp( psz_desc, "MusicBrainz Album Id", 20 ) ) if( !strncmp( psz_desc, "MusicBrainz Album Id", 20 ) )
vlc_meta_SetAlbumID( p_meta, vlc_meta_SetAlbumID( p_meta,
p_txxx->fieldList().toString().toCString() ); p_txxx->fieldList().toString().toCString());
} }
#endif #endif
} }
} }
DetectImage( f, p_meta ); DetectImage( f, p_meta );
return VLC_SUCCESS; return VLC_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment