[vlc-devel] [PATCH] MP3: support TRCK total number
Rémi Denis-Courmont
remi at remlab.net
Wed Jun 13 06:37:15 CEST 2012
On Wed, 13 Jun 2012 02:58:48 +0200, Jean-Baptiste Kempf <jb at videolan.org>
wrote:
> ---
> modules/meta_engine/taglib.cpp | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/modules/meta_engine/taglib.cpp
> b/modules/meta_engine/taglib.cpp
> index e1f63ee..5ea1981 100644
> --- a/modules/meta_engine/taglib.cpp
> +++ b/modules/meta_engine/taglib.cpp
> @@ -244,6 +244,22 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag,
> demux_meta_t* p_demux_meta, vlc_
>
> #undef SET
>
> + /* */
> + list = tag->frameListMap()["TRCK"];
> + if( !list.isEmpty() )
> + {
> + int i_trknum, i_trktot;
> + if( sscanf( (*list.begin())->toString().toCString( true ),
> + "%i/%i", &i_trknum, &i_trktot ) == 2 )
> + {
> + char psz_trck[11];
Why 11 bytes?
> + snprintf( psz_trck, sizeof( psz_trck ), "%i", i_trknum );
> + vlc_meta_SetTrackNum( p_meta, psz_trck );
> + snprintf( psz_trck, sizeof( psz_trck ), "%i", i_trktot );
> + vlc_meta_Set( p_meta, vlc_meta_TrackTotal, psz_trck );
> + }
> + }
> +
> /* Preferred type of image
> * The 21 types are defined in id3v2 standard:
> * http://www.id3.org/id3v2.4.0-frames */
--
Rémi Denis-Courmont
Sent from my collocated server
More information about the vlc-devel
mailing list