# HG changeset patch # User Calin Crisan ccrisan@gmail.com # Date 1191369224 -10800 # Node ID 10705f679abe167c360af3d160e39fe2621dfd3f # Parent 600972dea2ac007024989ccc0f5959c25a1cb9d6# Parent f85a079573c39a762a56a12c6b9a66f2c5af4c68 Automated merge with ssh://hg.atheme.org//hg/audacious-plugins diff -r 600972dea2ac -r 10705f679abe src/OSS/configure.c --- a/src/OSS/configure.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/OSS/configure.c Wed Oct 03 02:53:44 2007 +0300 @@ -27,7 +27,6 @@ #include #include -#include #include diff -r 600972dea2ac -r 10705f679abe src/cue/cuesheet.c --- a/src/cue/cuesheet.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/cue/cuesheet.c Wed Oct 03 02:53:44 2007 +0300 @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff -r 600972dea2ac -r 10705f679abe src/daap/daap.c --- a/src/daap/daap.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/daap/daap.c Wed Oct 03 02:53:44 2007 +0300 @@ -20,7 +20,6 @@ #include -#include #include #include diff -r 600972dea2ac -r 10705f679abe src/dockalbumart/dockalbumart.c --- a/src/dockalbumart/dockalbumart.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/dockalbumart/dockalbumart.c Wed Oct 03 02:53:44 2007 +0300 @@ -30,7 +30,6 @@ #include #include #include -#include #include "audacious_player.xpm" diff -r 600972dea2ac -r 10705f679abe src/flacng/flacng.h --- a/src/flacng/flacng.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/flacng/flacng.h Wed Oct 03 02:53:44 2007 +0300 @@ -19,12 +19,11 @@ #ifndef FLACNG_H #define FLACNG_H +#include "config.h" #include #include #include -#include #include -# include "config.h" #define OUTPUT_BLOCK_SIZE (8192u) #define MAX_SUPPORTED_CHANNELS (2u) diff -r 600972dea2ac -r 10705f679abe src/flacng/plugin.c --- a/src/flacng/plugin.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/flacng/plugin.c Wed Oct 03 02:53:44 2007 +0300 @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "flacng.h" #include #include #include -#include "flacng.h" #include "tools.h" #include "plugin.h" #include "seekable_stream_callbacks.h" diff -r 600972dea2ac -r 10705f679abe src/ladspa/ladspa.c --- a/src/ladspa/ladspa.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/ladspa/ladspa.c Wed Oct 03 02:53:44 2007 +0300 @@ -18,6 +18,8 @@ /* BMP-ladspa port by Giacomo Lozito */ +#include "config.h" + #include #include #include @@ -31,7 +33,6 @@ #include #include -#include "../../config.h" #include "ladspa.h" #ifndef PATH_MAX diff -r 600972dea2ac -r 10705f679abe src/madplug/plugin.h --- a/src/madplug/plugin.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/madplug/plugin.h Wed Oct 03 02:53:44 2007 +0300 @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include diff -r 600972dea2ac -r 10705f679abe src/metronom/metronom.c --- a/src/metronom/metronom.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/metronom/metronom.c Wed Oct 03 02:53:44 2007 +0300 @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" #include #include #include -#include "../../config.h" #include #include diff -r 600972dea2ac -r 10705f679abe src/mms/mms.c --- a/src/mms/mms.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/mms/mms.c Wed Oct 03 02:53:44 2007 +0300 @@ -18,7 +18,6 @@ #include -#include #include #include diff -r 600972dea2ac -r 10705f679abe src/modplug/sndmix.cxx --- a/src/modplug/sndmix.cxx Wed Oct 03 02:47:26 2007 +0300 +++ b/src/modplug/sndmix.cxx Wed Oct 03 02:53:44 2007 +0300 @@ -307,7 +307,6 @@ } else { m_nMixStat += CreateStereoMix(lCount); - if (nMaxPlugins) ProcessPlugins(lCount); ProcessStereoDSP(lCount); X86_MonoFromStereo(MixSoundBuffer, lCount); } diff -r 600972dea2ac -r 10705f679abe src/modplug/stdafx.h --- a/src/modplug/stdafx.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/modplug/stdafx.h Wed Oct 03 02:53:44 2007 +0300 @@ -19,8 +19,6 @@ #include #include -inline void ProcessPlugins(int n) {} - #elif defined(__x86_64__) || defined(__powerpc64__) #include @@ -74,8 +72,6 @@ return p; } -inline void ProcessPlugins(int n) {} - #define GlobalFreePtr(p) free((void *)(p)) #define strnicmp(a,b,c) strncasecmp(a,b,c) @@ -152,8 +148,6 @@ return p; } -inline void ProcessPlugins(int n) {} - #define GlobalFreePtr(p) free((void *)(p)) #define strnicmp(a,b,c) strncasecmp(a,b,c) diff -r 600972dea2ac -r 10705f679abe src/neon/neon.c --- a/src/neon/neon.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/neon/neon.c Wed Oct 03 02:53:44 2007 +0300 @@ -17,7 +17,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include "neon.h" + #include #include @@ -28,7 +29,6 @@ #include #include "debug.h" -#include "neon.h" #include "rb.h" #define NBUFSIZ (128u*1024u) diff -r 600972dea2ac -r 10705f679abe src/neon/neon.h --- a/src/neon/neon.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/neon/neon.h Wed Oct 03 02:53:44 2007 +0300 @@ -20,6 +20,8 @@ #ifndef _NEON_PLUGIN_H #define _NEON_PLUGIN_H +#include "config.h" + #include #include #include diff -r 600972dea2ac -r 10705f679abe src/pls/pls.c --- a/src/pls/pls.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/pls/pls.c Wed Oct 03 02:53:44 2007 +0300 @@ -36,7 +36,6 @@ #include #include #include -#include #include static void diff -r 600972dea2ac -r 10705f679abe src/shnplug/id3v2.c --- a/src/shnplug/id3v2.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/shnplug/id3v2.c Wed Oct 03 02:53:44 2007 +0300 @@ -20,13 +20,10 @@ * $Id: id3v2.c,v 1.6 2007/03/23 05:49:48 jason Exp $ */ +#include "config.h" #include #include "shorten.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #define ID3V2_MAGIC "ID3" typedef struct { diff -r 600972dea2ac -r 10705f679abe src/shnplug/shorten.h --- a/src/shnplug/shorten.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/shnplug/shorten.h Wed Oct 03 02:53:44 2007 +0300 @@ -13,9 +13,7 @@ #ifndef _SHORTEN_H #define _SHORTEN_H -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include #include diff -r 600972dea2ac -r 10705f679abe src/smb/smb.c --- a/src/smb/smb.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/smb/smb.c Wed Oct 03 02:53:44 2007 +0300 @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "config.h" #include #include diff -r 600972dea2ac -r 10705f679abe src/tonegen/tonegen.c --- a/src/tonegen/tonegen.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/tonegen/tonegen.c Wed Oct 03 02:53:44 2007 +0300 @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "config.h" #include #include #include #include -#include "config.h" #include #include #include diff -r 600972dea2ac -r 10705f679abe src/tta/libtta.c --- a/src/tta/libtta.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/tta/libtta.c Wed Oct 03 02:53:44 2007 +0300 @@ -45,7 +45,6 @@ #include #include #include - #include #define PLUGIN_VERSION "1.4" diff -r 600972dea2ac -r 10705f679abe src/xspf/xspf.c --- a/src/xspf/xspf.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/xspf/xspf.c Wed Oct 03 02:53:44 2007 +0300 @@ -30,11 +30,11 @@ #include #include +#include #include #include #include #include -#include #include #include @@ -78,14 +78,22 @@ static const gint xspf_nentries = (sizeof(xspf_entries) / sizeof(xspf_entry_t)); +#ifdef DEBUG +# define XSDEBUG(...) { fprintf(stderr, "xspf[%s:%d]: ", __FUNCTION__, (int) __LINE__); fprintf(stderr, __VA_ARGS__); } +#else +# define XSDEBUG(...) /* stub */ +#endif + + static gboolean is_uri(gchar *uri) { - if(strstr(uri, "://")) + if (strstr(uri, "://")) return TRUE; else return FALSE; } + /* This function is taken from libxml2-2.6.27. */ static xmlChar *xspf_path_to_uri(const xmlChar *path) @@ -115,7 +123,8 @@ } -static void xspf_add_file(xmlNode *track, const gchar *filename, gint pos, const gchar *base) +static void xspf_add_file(xmlNode *track, const gchar *filename, + gint pos, const gchar *base) { xmlNode *nptr; Tuple *tuple; @@ -196,10 +205,9 @@ tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, strrchr(location, '.')); -#ifdef DEBUG - printf("xspf: tuple->file_name = %s\n", tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); - printf("xspf: tuple->file_path = %s\n", tuple_get_string(tuple, FIELD_FILE_PATH, NULL)); -#endif + XSDEBUG("tuple->file_name = %s\n", tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); + XSDEBUG("tuple->file_path = %s\n", tuple_get_string(tuple, FIELD_FILE_PATH, NULL)); + // add file to playlist uri = g_filename_to_uri(location, NULL, NULL); // uri would be NULL if location is already uri. --yaz @@ -212,7 +220,8 @@ } -static void xspf_find_track(xmlNode *tracklist, const gchar *filename, gint pos, const gchar *base) +static void xspf_find_track(xmlNode *tracklist, const gchar *filename, + gint pos, const gchar *base) { xmlNode *nptr; @@ -242,7 +251,6 @@ playlist->attribute ^= PLAYLIST_STATIC; xmlFree(opt); - opt = NULL; } } } @@ -252,39 +260,37 @@ { xmlDocPtr doc; xmlNode *nptr, *nptr2; - gchar *tmp = NULL, *base = NULL; g_return_if_fail(filename != NULL); -#ifdef DEBUG - printf("playlist_load_xspf: filename = %s\n", filename); -#endif + XSDEBUG("filename='%s', pos=%d\n", filename, pos); doc = xmlRecoverFile(filename); - if(doc == NULL) + if (doc == NULL) return; // find trackList for (nptr = doc->children; nptr != NULL; nptr = nptr->next) { if (nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"playlist")) { + gchar *tmp, *base; + base = (gchar *)xmlNodeGetBase(doc, nptr); -#ifdef DEBUG - printf("playlist_load_xspf: base @1 = %s\n", base); -#endif + + XSDEBUG("base @1 = %s\n", base); + // if filename is specified as a base, ignore it. tmp = xmlURIUnescapeString(base, -1, NULL); - if(tmp) { - if(!strcmp(tmp, filename)) { + if (tmp) { + if (!strcmp(tmp, filename)) { xmlFree(base); base = NULL; } g_free(tmp); - tmp = NULL; } -#ifdef DEBUG - printf("playlist_load_xspf: base @2 = %s\n", base); -#endif + + XSDEBUG("base @2 = %s\n", base); + for (nptr2 = nptr->children; nptr2 != NULL; nptr2 = nptr2->next) { if (nptr2->type == XML_ELEMENT_NODE && @@ -306,7 +312,7 @@ } xmlFree(title); } else - if(nptr2->type == XML_ELEMENT_NODE && + if (nptr2->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr2->name, (xmlChar *)"trackList")) { xspf_find_track(nptr2, filename, pos, base); } @@ -317,9 +323,9 @@ } -static void xspf_add_node( - xmlNodePtr node, TupleValueType type, gboolean isMeta, - const gchar *xspfName, const gchar *strVal, const gint intVal) +static void xspf_add_node(xmlNodePtr node, TupleValueType type, + gboolean isMeta, const gchar *xspfName, const gchar *strVal, + const gint intVal) { gchar tmps[64]; xmlNodePtr tmp; @@ -357,9 +363,7 @@ gchar *base = NULL; Playlist *playlist = playlist_get_active(); -#ifdef DEBUG - printf("playlist_save_xspf: filename = %s\n", filename); -#endif + XSDEBUG("filename='%s', pos=%d\n", filename, pos); doc = xmlNewDoc((xmlChar *)"1.0"); doc->charset = XML_CHAR_ENCODING_UTF8; @@ -381,15 +385,13 @@ gint tmplen = 0; if (!is_uri(entry->filename)) { //obsolete - gchar *tmp2; - tmp2 = g_path_get_dirname(entry->filename); + gchar *tmp2 = g_path_get_dirname(entry->filename); tmp = g_strdup_printf("%s/", tmp2); g_free(tmp2); - } else { + } else tmp = g_strdup(entry->filename); - } - if(!base) { + if (!base) { base = strdup(tmp); baselen = strlen(base); } @@ -409,43 +411,34 @@ g_free(base); base = tmp; baselen = tmplen; -#ifdef DEBUG - printf("base = \"%s\" baselen = %d\n", base, baselen); -#endif - } - else { + XSDEBUG("base='%s', baselen=%d\n", base, baselen); + } else g_free(tmp); - tmp = NULL; - } } /* set base URI */ if (base) { gchar *tmp; - if(!is_uri(base)) { + if (!is_uri(base)) { tmp = (gchar *) xspf_path_to_uri((xmlChar *)base); - if(tmp) { + if (tmp) { g_free(base); base = tmp; } } - if(!is_uri(base)) { -#ifdef DEBUG - printf("base is not uri. something is wrong.\n"); -#endif + if (!is_uri(base)) { + XSDEBUG("base is not uri. something is wrong.\n"); tmp = g_strdup_printf("file://%s", base); xmlSetProp(rootnode, (xmlChar *)"xml:base", (xmlChar *)tmp); g_free(tmp); - } - else + } else xmlSetProp(rootnode, (xmlChar *)"xml:base", (xmlChar *)base); } } /* USE_RELATIVE */ /* common */ xmlDocSetRootElement(doc, rootnode); - xspf_add_node(rootnode, TUPLE_STRING, FALSE, "creator", PACKAGE "-" VERSION, 0); /* add staticlist marker */ @@ -471,7 +464,7 @@ tracklist = xmlNewNode(NULL, (xmlChar *)"trackList"); xmlAddChild(rootnode, tracklist); - for(node = playlist->entries; node != NULL; node = g_list_next(node)) { + for (node = playlist->entries; node != NULL; node = g_list_next(node)) { PlaylistEntry *entry = PLAYLIST_ENTRY(node->data); xmlNodePtr track, location; gchar *filename = NULL; @@ -481,26 +474,21 @@ track = xmlNewNode(NULL, (xmlChar *)"track"); location = xmlNewNode(NULL, (xmlChar *)"location"); - if(is_uri(entry->filename)) { /* uri */ -#ifdef DEBUG - printf("filename is uri\n"); -#endif + if (is_uri(entry->filename)) { /* uri */ + XSDEBUG("filename is uri\n"); filename = g_strdup(entry->filename + baselen); // entry->filename is always uri now. - } - else { /* local file (obsolete) */ + } else { /* local file (obsolete) */ gchar *tmp = (gchar *) xspf_path_to_uri((const xmlChar *)entry->filename + baselen); - if(base) { /* relative */ + if (base) { /* relative */ filename = g_strdup_printf("%s", tmp); } else { -#ifdef DEBUG - printf("absolute and local (obsolete)\n"); -#endif + XSDEBUG("absolute and local (obsolete)\n"); filename = g_filename_to_uri(tmp, NULL, NULL); } - g_free(tmp); tmp = NULL; + g_free(tmp); } /* obsolete */ - if(!g_utf8_validate(filename, -1, NULL)) + if (!g_utf8_validate(filename, -1, NULL)) continue; xmlAddChild(location, xmlNewText((xmlChar *)filename)); @@ -557,17 +545,13 @@ } g_free(filename); - filename = NULL; } PLAYLIST_UNLOCK(playlist); xmlSaveFormatFile(filename, doc, 1); xmlFreeDoc(doc); - doc = NULL; - xmlFree(base); - base = NULL; } @@ -578,14 +562,17 @@ .plc_write = xspf_playlist_save, }; + static void xspf_init(void) { playlist_container_register(&plc_xspf); } + static void xspf_cleanup(void) { playlist_container_unregister(&plc_xspf); } + DECLARE_PLUGIN(xspf, xspf_init, xspf_cleanup, NULL, NULL, NULL, NULL, NULL, NULL);