Commit cb4a20b9 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

MP3: support TRCK total number

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 42a7f46d
...@@ -108,6 +108,18 @@ vlc_module_end () ...@@ -108,6 +108,18 @@ vlc_module_end ()
using namespace TagLib; using namespace TagLib;
static void ExtractTrackNumberValues( vlc_meta_t* p_meta, const char *psz_value )
{
unsigned int i_trknum, i_trktot;
if( sscanf( psz_value, "%u/%u", &i_trknum, &i_trktot ) == 2 )
{
char psz_trck[11];
snprintf( psz_trck, sizeof( psz_trck ), "%u", i_trknum );
vlc_meta_SetTrackNum( p_meta, psz_trck );
snprintf( psz_trck, sizeof( psz_trck ), "%u", i_trktot );
vlc_meta_Set( p_meta, vlc_meta_TrackTotal, psz_trck );
}
}
/** /**
* Read meta information from APE tags * Read meta information from APE tags
...@@ -244,6 +256,13 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_meta_t* p_demux_meta, vlc_ ...@@ -244,6 +256,13 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_meta_t* p_demux_meta, vlc_
#undef SET #undef SET
/* */
list = tag->frameListMap()["TRCK"];
if( !list.isEmpty() )
{
ExtractTrackNumberValues( p_meta, (*list.begin())->toString().toCString( true ) );
}
/* Preferred type of image /* Preferred type of image
* The 21 types are defined in id3v2 standard: * The 21 types are defined in id3v2 standard:
* http://www.id3.org/id3v2.4.0-frames */ * http://www.id3.org/id3v2.4.0-frames */
......
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