- for( ; i_comment > 0; i_comment-- )
- {
- char *psz;
- if( i_data < 4 )
- break;
- n = GetDWLE(p_data); RM(4);
- if( n > i_data )
- break;
- if( n <= 0 )
- continue;
-
- psz = strndup( p_data, n );
- RM(n);
-
- EnsureUTF8( psz );
-
-#define IF_EXTRACT(txt,var) if( !strncasecmp(psz, txt, strlen(txt)) ) { astrcat( &p_sys->p_meta->var, &psz[strlen(txt)] ); }
- IF_EXTRACT("TITLE=", psz_title )
- else IF_EXTRACT("ALBUM=", psz_album )
- else IF_EXTRACT("TRACKNUMBER=", psz_tracknum )
- else IF_EXTRACT("ARTIST=", psz_artist )
- else IF_EXTRACT("COPYRIGHT=", psz_copyright )
- else IF_EXTRACT("DESCRIPTION=", psz_description )
- else IF_EXTRACT("GENRE=", psz_genre )
- else IF_EXTRACT("DATE=", psz_date )
- else if( strchr( psz, '=' ) )
- {
- /* generic (PERFORMER/LICENSE/ORGANIZATION/LOCATION/CONTACT/ISRC,
- * undocumented tags and replay gain ) */
- audio_replay_gain_t *r = &p_sys->replay_gain;
- char *p = strchr( psz, '=' );
- *p++ = '\0';
- vlc_meta_AddExtra( p_sys->p_meta, psz, p );
- }
-#undef IF_EXTRACT
- free( psz );
- }
-#undef RM