From: Guenter B. <gu...@us...> - 2003-04-08 22:07:52
|
Update of /cvsroot/xine/gnome-xine/src In directory sc8-pr-cvs1:/tmp/cvs-serv1591/src Modified Files: playlist.c Log Message: improve PLS handling (local files / http) Index: playlist.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/playlist.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- playlist.c 6 Apr 2003 22:58:14 -0000 1.63 +++ playlist.c 8 Apr 2003 22:07:47 -0000 1.64 @@ -606,17 +606,26 @@ int size, i, num_entries; char mime_type[256]; - /* get mime type */ - http_peek(mrl, 0, contents, mime_type); + /* http or local file ? */ - if (!strcmp(mime_type, "audio/mpeg")) { - /* add directly to playlist */ + if (!strncmp (mrl, "http://", 7)) { - return playlist_add_int (mrl); - } + /* get mime type */ + http_peek(mrl, 0, contents, mime_type); + + if (!strcmp(mime_type, "audio/mpeg")) { + /* add directly to playlist */ + + return playlist_add_int (mrl); + } - if (! (contents = read_entire_file (mrl, &size)) ) - return FALSE; + if (! (contents = http_download (mrl, &size))) + return FALSE; + } else { + + if (! (contents = read_entire_file (mrl, &size)) ) + return FALSE; + } lines = g_strsplit (contents, "\n", 0); g_free (contents); |