[vlc-devel] [PATCH 5/7] Add support for parsing more Ogg tags
Jean-Baptiste Kempf
jb at videolan.org
Mon Sep 2 20:34:56 CEST 2013
On 02 Sep, Timothy B. Terriberry wrote :
> - bool hasAlbum = false;
> + bool hasAlbum = false;
??
> + bool hasGenre = false;
> - bool hasGenre = false;
???
> - bool hasTrackTotal = false;
> + bool hasTrackTotal = false;
???
> + else IF_EXTRACT("ARTIST=", Artist )
> + else IF_EXTRACT("GENRE=", Genre )
> + else IF_EXTRACT("COPYRIGHT=", Copyright )
OK.
> else IF_EXTRACT("ALBUM=", Album )
> else if( !strncasecmp(psz_comment, "TRACKNUMBER=", strlen("TRACKNUMBER=" ) ) )
> {
> /* Yeah yeah, such a clever idea, let's put xx/xx inside TRACKNUMBER
> * Oh, and let's not use TRACKTOTAL or TOTALTRACKS... */
> short unsigned u_track, u_total;
> if( sscanf( &psz_comment[strlen("TRACKNUMBER=")], "%hu/%hu", &u_track, &u_total ) == 2 )
> {
> char str[6];
> - snprintf(str, 6, "%d", u_track);
> + snprintf(str, 6, "%u", u_track);
> vlc_meta_Set( p_meta, vlc_meta_TrackNumber, str );
> - snprintf(str, 6, "%d", u_total);
> + hasTrackNum = true;
> + snprintf(str, 6, "%u", u_total);
> vlc_meta_Set( p_meta, vlc_meta_TrackTotal, str );
> + hasTrackTotal = true;
> }
> else
> + {
> vlc_meta_Set( p_meta, vlc_meta_TrackNumber, &psz_comment[strlen("TRACKNUMBER=")] );
> + hasTrackNum = true;
> + }
> }
OK.
> - else if( !strncasecmp(psz_comment, "TRACKTOTAL=", strlen("TRACKTOTAL=")))
> - vlc_meta_Set( p_meta, vlc_meta_TrackTotal, &psz_comment[strlen("TRACKTOTAL=")] );
> - else if( !strncasecmp(psz_comment, "TOTALTRACKS=", strlen("TOTALTRACKS=")))
> - vlc_meta_Set( p_meta, vlc_meta_TrackTotal, &psz_comment[strlen("TOTALTRACKS=")] );
> + else IF_EXTRACT("TRACKTOTAL=", TrackTotal )
Why this change?
Because I think I disagree.
Best regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
More information about the vlc-devel
mailing list