changeset 2812:f2267c25ca0b

Automated merge with ssh://hg.atheme-project.org//hg//audacious-plugins
author Calin Crisan ccrisan@gmail.com
date Sat, 12 Jul 2008 13:56:15 +0300
parents f06ec6936b7e (current diff) 7977bdc02664 (diff)
children 21cff0510f38
files src/streambrowser/shoutcast.xml
diffstat 9 files changed, 160 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- 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 <ccrisan@gmail.com>
+ *
+ * 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 <http://www.gnu.org/licenses>.
+ */
 
+
--- 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 <ccrisan@gmail.com>
+ *
+ * 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 <http://www.gnu.org/licenses>.
+ */
+
 
 #ifndef ABOUT_WIN_H
 #define ABOUT_WIN_H
--- 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 <ccrisan@gmail.com>
+ *
+ * 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 <http://www.gnu.org/licenses>.
+ */
+
 
 #include <string.h>
 #include <glib.h>
@@ -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;
--- 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 <ccrisan@gmail.com>
+ *
+ * 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 <http://www.gnu.org/licenses>.
+ */
+
 
 #ifndef SHOUTCAST_H
 #define SHOUTCAST_H
--- 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 @@
-<?xml version="1.0" encoding='UTF-8' standalone="yes"?>
-<genrelist>
-<genre name="24h"></genre>
-<genre name="Acid"></genre>
-<genre name="Adult"></genre>
-<genre name="Adulto"></genre>
-<genre name="African"></genre>
-<genre name="Afrikaans"></genre>
-<genre name="Afro"></genre>
-<genre name="Zouk"></genre>
-</genrelist>
-
--- 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 <ccrisan@gmail.com>
+ *
+ * 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 <http://www.gnu.org/licenses>.
+ */
+
 
 #include <stdlib.h>
 #include <gtk/gtk.h>
@@ -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()
--- 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 <ccrisan@gmail.com>
+ *
+ * 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 <http://www.gnu.org/licenses>.
+ */
+
 
 #ifndef STREAMBROWSER_H
 #define STREAMBROWSER_H
--- 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 <ccrisan@gmail.com>
+ *
+ * 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 <http://www.gnu.org/licenses>.
+ */
+
 
 #include <string.h>
 #include <glib.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 <ccrisan@gmail.com>
+ *
+ * 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 <http://www.gnu.org/licenses>.
+ */
+
 
 #ifndef STREAMDIR_H
 #define STREAMDIR_H