From: Ilkka Ollakka Date: Sun, 26 Aug 2007 19:59:02 +0000 (+0000) Subject: xspf.c: add album-art as and use Title in title (if available), X-Git-Tag: 0.9.0-test0~6121 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=222b887fd6fe6d7243aeddac082c18e019eb2081;p=vlc xspf.c: add album-art as and use Title in title (if available), xspf-specs seems to agree that it's valid this way. (title tag MAY appear once in item) --- diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c index c33a4197ae..599c7671ea 100644 --- a/modules/demux/playlist/xspf.c +++ b/modules/demux/playlist/xspf.c @@ -155,7 +155,7 @@ static vlc_bool_t parse_playlist_node COMPLEX_INTERFACE {"info", SIMPLE_CONTENT, {NULL} }, {"location", SIMPLE_CONTENT, {NULL} }, {"identifier", SIMPLE_CONTENT, {NULL} }, - {"image", SIMPLE_CONTENT, {NULL} }, + {"image", SIMPLE_CONTENT, {.smpl = set_item_info} }, {"date", SIMPLE_CONTENT, {NULL} }, {"license", SIMPLE_CONTENT, {NULL} }, {"attribution", COMPLEX_CONTENT, {.cmplx = skip_element} }, @@ -386,7 +386,7 @@ static vlc_bool_t parse_track_node COMPLEX_INTERFACE {"creator", SIMPLE_CONTENT, {.smpl = set_item_info} }, {"annotation", SIMPLE_CONTENT, {.smpl = set_item_info} }, {"info", SIMPLE_CONTENT, {NULL} }, - {"image", SIMPLE_CONTENT, {NULL} }, + {"image", SIMPLE_CONTENT, {.smpl = set_item_info} }, {"album", SIMPLE_CONTENT, {.smpl = set_item_info} }, {"trackNum", SIMPLE_CONTENT, {.smpl = set_item_info} }, {"duration", SIMPLE_CONTENT, {.smpl = set_item_info} }, @@ -610,7 +610,7 @@ static vlc_bool_t set_item_info SIMPLE_INTERFACE /* handle each info element in a separate "if" clause */ if( !strcmp( psz_name, "title" ) ) { - p_input->psz_name = strdup( (char*)psz_value ); + input_item_SetTitle( p_input, psz_value ); } else if( !strcmp( psz_name, "creator" ) ) { @@ -634,6 +634,10 @@ static vlc_bool_t set_item_info SIMPLE_INTERFACE { input_item_SetDescription( p_input, psz_value ); } + else if( !strcmp( psz_name, "image" ) ) + { + input_item_SetArtURL( p_input, psz_value ); + } return VLC_TRUE; } diff --git a/modules/misc/playlist/xspf.c b/modules/misc/playlist/xspf.c index 8f732e4fc2..c55ace4880 100644 --- a/modules/misc/playlist/xspf.c +++ b/modules/misc/playlist/xspf.c @@ -150,7 +150,7 @@ static void xspf_export_item( playlist_item_t *p_item, FILE *p_file, } /* -> the name/title (only if different from uri)*/ - char *psz_name = input_item_GetName( p_item->p_input ); + char *psz_name = input_item_GetTitle( p_item->p_input ); if( psz_name && psz_uri && strcmp( psz_uri, psz_name ) ) { psz_temp = convert_xml_special_chars( psz_name ); @@ -211,6 +211,13 @@ static void xspf_export_item( playlist_item_t *p_item, FILE *p_file, } free( psz_temp ); + psz = input_item_GetArtURL( p_item->p_input ); + if( !EMPTY_STR( psz ) ) + { + fprintf( p_file, "\t\t\t%s\n", psz ); + } + free( psz ); + xspfexportitem_end: /* -> the duration */ i_duration = input_item_GetDuration( p_item->p_input );