[vlc-commits] commit: m3u: use the album art provided by jamendo along with the m3u files . ( Rémi Duraffort )

git at videolan.org git at videolan.org
Wed Jul 21 22:05:17 CEST 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Jul 21 21:54:22 2010 +0200| [fdbda6fec038e314228314288d29e2c218c0aeef] | committer: Rémi Denis-Courmont 

m3u: use the album art provided by jamendo along with the m3u files.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fdbda6fec038e314228314288d29e2c218c0aeef
---

 modules/demux/playlist/m3u.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index 9320a6b..2ac9622 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -136,6 +136,7 @@ static int Demux( demux_t *p_demux )
     char       *psz_line;
     char       *psz_name = NULL;
     char       *psz_artist = NULL;
+    char       *psz_album_art = NULL;
     int        i_parsed_duration = 0;
     mtime_t    i_duration = -1;
     const char**ppsz_options = NULL;
@@ -194,6 +195,14 @@ static int Demux( demux_t *p_demux )
                     INSERT_ELEM( ppsz_options, i_options, i_options,
                                  psz_option );
             }
+            /* Special case for jamendo which provide the albumart */
+            else if( !strncasecmp( psz_parse, "EXTALBUMARTURL:",
+                     sizeof( "EXTALBUMARTURL:" ) -1 ) )
+            {
+                psz_parse += sizeof( "EXTALBUMARTURL:" ) - 1;
+                free( psz_album_art );
+                psz_album_art = pf_dup( psz_parse );
+            }
         }
         else if( !strncasecmp( psz_parse, "RTSPtext", sizeof("RTSPtext") -1 ) )
         {
@@ -226,6 +235,8 @@ static int Demux( demux_t *p_demux )
             if ( psz_artist && *psz_artist )
                 input_item_SetArtist( p_input, psz_artist );
             if( psz_name ) input_item_SetTitle( p_input, psz_name );
+            if( !EMPTY_STR(psz_album_art) )
+                input_item_SetArtURL( p_input, psz_album_art );
 
             input_item_node_AppendItem( p_subitems, p_input );
             vlc_gc_decref( p_input );
@@ -248,6 +259,8 @@ static int Demux( demux_t *p_demux )
             psz_name = NULL;
             free( psz_artist );
             psz_artist = NULL;
+            free( psz_album_art );
+            psz_album_art = NULL;
             i_parsed_duration = 0;
             i_duration = -1;
 



More information about the vlc-commits mailing list