# HG changeset patch # User Calin Crisan ccrisan@gmail.com # Date 1215860175 -10800 # Node ID f2267c25ca0b265b4eed75584a88529e6c349e1a # Parent f06ec6936b7e1f63633a72057f54fea75ea0c54f# Parent 7977bdc02664013f08d051fbee1cb7ace7cac5fd Automated merge with ssh://hg.atheme-project.org//hg//audacious-plugins diff -r f06ec6936b7e -r f2267c25ca0b src/streambrowser/gui/about_win.c --- a/src/streambrowser/gui/about_win.c Sat Jul 12 04:00:23 2008 +0300 +++ b/src/streambrowser/gui/about_win.c Sat Jul 12 13:56:15 2008 +0300 @@ -1,1 +1,19 @@ +/* + * Audacious Streambrowser Plugin + * + * Copyright (c) 2008 Calin Crisan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + diff -r f06ec6936b7e -r f2267c25ca0b src/streambrowser/gui/about_win.h --- a/src/streambrowser/gui/about_win.h Sat Jul 12 04:00:23 2008 +0300 +++ b/src/streambrowser/gui/about_win.h Sat Jul 12 13:56:15 2008 +0300 @@ -1,3 +1,21 @@ +/* + * Audacious Streambrowser Plugin + * + * Copyright (c) 2008 Calin Crisan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef ABOUT_WIN_H #define ABOUT_WIN_H diff -r f06ec6936b7e -r f2267c25ca0b src/streambrowser/shoutcast.c --- a/src/streambrowser/shoutcast.c Sat Jul 12 04:00:23 2008 +0300 +++ b/src/streambrowser/shoutcast.c Sat Jul 12 13:56:15 2008 +0300 @@ -1,3 +1,21 @@ +/* + * Audacious Streambrowser Plugin + * + * Copyright (c) 2008 Calin Crisan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include @@ -23,11 +41,11 @@ char temp_pathname[DEF_STRING_LEN]; sprintf(temp_pathname, "file://%s", temp_filename); - free(temp_filename); debug("shoutcast: fetching category file '%s'\n", url); if (!fetch_remote_to_local_file(url, temp_pathname)) { failure("shoutcast: category file '%s' could not be downloaded to '%s'\n", url, temp_pathname); + free(temp_filename); return FALSE; } debug("shoutcast: category file '%s' successfuly downloaded to '%s'\n", url, temp_pathname); @@ -35,6 +53,7 @@ xmlDoc *doc = xmlReadFile(temp_pathname, NULL, 0); if (doc == NULL) { failure("shoutcast: failed to read '%s' category file\n", category->name); + free(temp_filename); return FALSE; } @@ -65,8 +84,11 @@ } } - remove(temp_filename); - // todo: free the mallocs() + if (remove(temp_filename) != 0) { + failure("shoutcast: cannot remove the temporary file: %s\n", strerror(errno)); + } + free(temp_filename); + // todo: free the xml mallocs() return TRUE; } @@ -85,11 +107,11 @@ char temp_pathname[DEF_STRING_LEN]; sprintf(temp_pathname, "file://%s", temp_filename); - free(temp_filename); debug("shoutcast: fetching streaming directory file '%s'\n", SHOUTCAST_STREAMDIR_URL); if (!fetch_remote_to_local_file(SHOUTCAST_STREAMDIR_URL, temp_pathname)) { failure("shoutcast: stream directory file '%s' could not be downloaded to '%s'\n", SHOUTCAST_STREAMDIR_URL, temp_pathname); + free(temp_filename); return NULL; } debug("shoutcast: stream directory file '%s' successfuly downloaded to '%s'\n", SHOUTCAST_STREAMDIR_URL, temp_pathname); @@ -97,6 +119,7 @@ xmlDoc *doc = xmlReadFile(temp_pathname, NULL, 0); if (doc == NULL) { failure("shoutcast: failed to read stream directory file\n"); + free(temp_filename); return NULL; } @@ -120,9 +143,13 @@ } } - // todo: free the mallocs() + // todo: free the xml mallocs() - remove(temp_filename); + if (remove(temp_filename) != 0) { + failure("shoutcast: cannot remove the temporary file: %s\n", strerror(errno)); + } + free(temp_filename); + debug("shoutcast: streaming directory successfuly loaded\n"); return streamdir; diff -r f06ec6936b7e -r f2267c25ca0b src/streambrowser/shoutcast.h --- a/src/streambrowser/shoutcast.h Sat Jul 12 04:00:23 2008 +0300 +++ b/src/streambrowser/shoutcast.h Sat Jul 12 13:56:15 2008 +0300 @@ -1,3 +1,21 @@ +/* + * Audacious Streambrowser Plugin + * + * Copyright (c) 2008 Calin Crisan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef SHOUTCAST_H #define SHOUTCAST_H diff -r f06ec6936b7e -r f2267c25ca0b src/streambrowser/shoutcast.xml --- a/src/streambrowser/shoutcast.xml Sat Jul 12 04:00:23 2008 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff -r f06ec6936b7e -r f2267c25ca0b src/streambrowser/streambrowser.c --- a/src/streambrowser/streambrowser.c Sat Jul 12 04:00:23 2008 +0300 +++ b/src/streambrowser/streambrowser.c Sat Jul 12 13:56:15 2008 +0300 @@ -1,3 +1,21 @@ +/* + * Audacious Streambrowser Plugin + * + * Copyright (c) 2008 Calin Crisan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include @@ -390,7 +408,7 @@ } debug("stream playlist '%s' successfuly downloaded to '%s'\n", streaminfo->playlist_url, PLAYLIST_TEMP_FILE); - aud_playlist_add_url(aud_playlist_get_active(), PLAYLIST_TEMP_FILE); + aud_playlist_add_url(aud_playlist_get_active(), PLAYLIST_TEMP_FILE); } static void on_plugin_services_menu_item_click() diff -r f06ec6936b7e -r f2267c25ca0b src/streambrowser/streambrowser.h --- a/src/streambrowser/streambrowser.h Sat Jul 12 04:00:23 2008 +0300 +++ b/src/streambrowser/streambrowser.h Sat Jul 12 13:56:15 2008 +0300 @@ -1,3 +1,21 @@ +/* + * Audacious Streambrowser Plugin + * + * Copyright (c) 2008 Calin Crisan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef STREAMBROWSER_H #define STREAMBROWSER_H diff -r f06ec6936b7e -r f2267c25ca0b src/streambrowser/streamdir.c --- a/src/streambrowser/streamdir.c Sat Jul 12 04:00:23 2008 +0300 +++ b/src/streambrowser/streamdir.c Sat Jul 12 13:56:15 2008 +0300 @@ -1,3 +1,21 @@ +/* + * Audacious Streambrowser Plugin + * + * Copyright (c) 2008 Calin Crisan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include diff -r f06ec6936b7e -r f2267c25ca0b src/streambrowser/streamdir.h --- a/src/streambrowser/streamdir.h Sat Jul 12 04:00:23 2008 +0300 +++ b/src/streambrowser/streamdir.h Sat Jul 12 13:56:15 2008 +0300 @@ -1,3 +1,21 @@ +/* + * Audacious Streambrowser Plugin + * + * Copyright (c) 2008 Calin Crisan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef STREAMDIR_H #define STREAMDIR_H