Mercurial > audlegacy-plugins
changeset 1767:cc39bde22735
Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Mon, 24 Sep 2007 11:13:22 -0500 |
parents | c3fdb0e5a306 (current diff) cf97a7767faa (diff) |
children | e75a4add2e4b |
files | |
diffstat | 6 files changed, 64 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/src/aosd/ghosd.c Mon Sep 24 11:13:14 2007 -0500 +++ b/src/aosd/ghosd.c Mon Sep 24 11:13:22 2007 -0500 @@ -14,6 +14,7 @@ #include <stdio.h> #include <stdlib.h> #include <cairo/cairo-xlib-xrender.h> +#include <X11/Xlib.h> #include <X11/Xatom.h> #ifdef HAVE_XCOMPOSITE
--- a/src/cue/cuesheet.c Mon Sep 24 11:13:14 2007 -0500 +++ b/src/cue/cuesheet.c Mon Sep 24 11:13:22 2007 -0500 @@ -775,22 +775,21 @@ line[q] = '\0'; for (q++; line[q] && isspace((int) line[q]); q++); if (strcasecmp(line+p, "REM") == 0) { - gint r; - for (r = q; line[r] && !isspace((int) line[r]); r++); - if (!line[r]) + for (p = q; line[p] && !isspace((int) line[p]); p++); + if (!line[p]) continue; - line[r] = '\0'; - for (r++; line[r] && isspace((int) line[r]); r++); + line[p] = '\0'; + for (p++; line[p] && isspace((int) line[p]); p++); if(strcasecmp(line+q, "GENRE") == 0) { - fix_cue_argument(line+r); + fix_cue_argument(line+p); if (last_cue_track == 0) - cue_genre = str_to_utf8(line + r); + cue_genre = str_to_utf8(line + p); } if(strcasecmp(line+q, "DATE") == 0) { gchar *tmp; - fix_cue_argument(line+r); + fix_cue_argument(line+p); if (last_cue_track == 0) { - tmp = g_strdup(line + r); + tmp = g_strdup(line + p); if (tmp) { cue_year = strtok(tmp, "/"); // XXX: always in the same format? } @@ -808,9 +807,7 @@ else if (strcasecmp(line+p, "FILE") == 0) { gchar *tmp = g_path_get_dirname(f); fix_cue_argument(line+q); - cue_file = g_strdup_printf("%s/%s", tmp, line+q); - /* XXX: yaz might need to UTF validate this?? -nenolod */ - /* as far as I know, all FILEs are in plain ASCII -yaz */ + cue_file = g_strdup_printf("%s/%s", tmp, line+q); //XXX need to check encoding? g_free(tmp); } else if (strcasecmp(line+p, "TITLE") == 0) { @@ -838,19 +835,19 @@ cue_tracks[last_cue_track-1].title = NULL; } else if (strcasecmp(line+p, "INDEX") == 0) { + gint min, sec, frac; for (p = q; line[p] && !isspace((int) line[p]); p++); if (!line[p]) continue; for (p++; line[p] && isspace((int) line[p]); p++); for (q = p; line[q] && !isspace((int) line[q]); q++); - if (q-p >= 8 && line[p+2] == ':' && line[p+5] == ':') { - cue_tracks[last_cue_track-1].index = - ((line[p+0]-'0')*10 + (line[p+1]-'0')) * 60000 + - ((line[p+3]-'0')*10 + (line[p+4]-'0')) * 1000 + - ((line[p+6]-'0')*10 + (line[p+7]-'0')) * 10; - } - } - } + + if(sscanf(line+p, "%d:%d:%d", &min, &sec, &frac) == 3) { +// printf("%3d:%02d:%02d\n", min, sec, frac); + cue_tracks[last_cue_track-1].index = min * 60000 + sec * 1000 + frac * 10; + } + } + } vfs_fclose(file); }
--- a/src/neon/neon.c Mon Sep 24 11:13:14 2007 -0500 +++ b/src/neon/neon.c Mon Sep 24 11:13:22 2007 -0500 @@ -19,6 +19,7 @@ #include <audacious/vfs.h> #include <audacious/plugin.h> +#include <audacious/configdb.h> #include <ne_socket.h> #include <ne_utils.h> @@ -306,7 +307,7 @@ * ----- */ -static int auth_callback(void* userdata, const char* realm, int attempt, char* username, char* password) { +static int server_auth_callback(void* userdata, const char* realm, int attempt, char* username, char* password) { struct neon_handle* h = (struct neon_handle*)userdata; gchar* authcpy; @@ -515,9 +516,36 @@ static int open_handle(struct neon_handle* handle, unsigned long startbyte) { int ret; + ConfigDb* db; + gchar* proxy_host; + gchar* proxy_port_s; + gchar* endptr; + unsigned int proxy_port = 0; + gboolean use_proxy; _ENTER; + db = bmp_cfg_db_open(); + bmp_cfg_db_get_bool(db, NULL, "use_proxy", &use_proxy); + if (use_proxy) { + if (FALSE == bmp_cfg_db_get_string(db, NULL, "proxy_host", &proxy_host)) { + _ERROR("Could not read proxy host, disabling proxy use"); + use_proxy = FALSE; + } + if (FALSE == bmp_cfg_db_get_string(db, NULL, "proxy_port", &proxy_port_s)) { + _ERROR("Could not read proxy port, disabling proxy use"); + use_proxy = FALSE; + } + proxy_port = strtoul(proxy_port_s, &endptr, 10); + if (!((*proxy_port_s != '\0') && (*endptr == '\0') && (proxy_port < 65536))) { + /* + * Invalid data + */ + _ERROR("Invalid proxy port, disabling proxy use"); + use_proxy = FALSE; + } + } + handle->redircount = 0; _DEBUG("Parsing URL"); @@ -534,7 +562,7 @@ _DEBUG("Creating session"); handle->session = ne_session_create(handle->purl->scheme, handle->purl->host, handle->purl->port); - ne_add_server_auth(handle->session, NE_AUTH_BASIC, auth_callback, (void *)handle); + ne_add_server_auth(handle->session, NE_AUTH_BASIC, server_auth_callback, (void *)handle); ne_set_session_flag(handle->session, NE_SESSFLAG_ICYPROTO, 1); ne_set_session_flag(handle->session, NE_SESSFLAG_PERSIST, 0); ne_set_connect_timeout(handle->session, 10); @@ -542,6 +570,11 @@ ne_set_useragent(handle->session, "Audacious/1.4.0"); ne_redirect_register(handle->session); + if (use_proxy) { + _DEBUG("Using proxy: %s:%d", proxy_host, proxy_port); + ne_session_proxy(handle->session, proxy_host, proxy_port); + } + _DEBUG("Creating request"); ret = open_request(handle, startbyte);
--- a/src/sid/xs_fileinfo.c Mon Sep 24 11:13:14 2007 -0500 +++ b/src/sid/xs_fileinfo.c Mon Sep 24 11:13:22 2007 -0500 @@ -141,10 +141,7 @@ tmpNode = xs_fileinfostil->subTunes[0]; if (tmpNode) { - if (tmpNode->pName) - subName = tmpNode->pName; - else - subName = tmpNode->pTitle; + subName = tmpNode->pName; subAuthor = tmpNode->pAuthor; subInfo = tmpNode->pInfo; } else {
--- a/src/sid/xs_stil.c Mon Sep 24 11:13:14 2007 -0500 +++ b/src/sid/xs_stil.c Mon Sep 24 11:13:22 2007 -0500 @@ -262,6 +262,8 @@ default: /* Check if we are parsing an entry */ + xs_findnext(tmpLine, &linePos); + if (!tmpNode) { XS_STILDB_ERR(lineNum, tmpLine, "Entry data encountered outside of entry or syntax error!\n"); @@ -282,8 +284,10 @@ tmpNode->subTunes[subEntry]->pName = g_strdup(&tmpLine[9]); } else if (strncmp(tmpLine, " TITLE:", 8) == 0) { XS_STILDB_MULTI; - g_free(tmpNode->subTunes[subEntry]->pTitle); - tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]); + isMulti = TRUE; + if (!tmpNode->subTunes[subEntry]->pTitle) + tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]); + xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[2]); } else if (strncmp(tmpLine, " AUTHOR:", 8) == 0) { XS_STILDB_MULTI; g_free(tmpNode->subTunes[subEntry]->pAuthor); @@ -296,9 +300,10 @@ XS_STILDB_MULTI; isMulti = TRUE; xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), tmpLine); - } else if (strncmp(tmpLine, " ", 8) == 0) { + } else { if (isMulti) { - xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[8]); + xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), " "); + xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[linePos]); } else { XS_STILDB_ERR(lineNum, tmpLine, "Entry continuation found when isMulti == FALSE.\n");
--- a/src/wav/wav-sndfile.c Mon Sep 24 11:13:14 2007 -0500 +++ b/src/wav/wav-sndfile.c Mon Sep 24 11:13:22 2007 -0500 @@ -114,7 +114,7 @@ tuple_associate_string(ti, FIELD_ARTIST, NULL, sf_get_string(tmp_sndfile, SF_STR_ARTIST)); tuple_associate_string(ti, FIELD_COMMENT, NULL, sf_get_string(tmp_sndfile, SF_STR_COMMENT)); - tuple_associate_string(ti, -1, "date", sf_get_string(tmp_sndfile, SF_STR_DATE)); + tuple_associate_string(ti, FIELD_DATE, NULL, sf_get_string(tmp_sndfile, SF_STR_DATE)); tuple_associate_string(ti, -1, "software", sf_get_string(tmp_sndfile, SF_STR_SOFTWARE)); g_free(realfn); realfn = NULL;