Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37722048
en ru br
Репозитории ALT
4.1: 0.14a-alt5
4.0: 0.14a-alt5
3.0: 0.14a-alt5
www.altlinux.org/Changes

Группа :: Звук
Пакет: xmms-in-cdread

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: xmms-cdread-0.14a-debian.patch
Скачать


--- xmms-cdread-0.14a.orig/cdconf.c
+++ xmms-cdread-0.14a/cdconf.c
@@ -6,6 +6,7 @@
 #include <netinet/in.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 static GtkWidget *cd_configure_win, *cddb_dir_entry;
 static GtkWidget *format_entry, *device_entry;
--- xmms-cdread-0.14a.orig/server.c
+++ xmms-cdread-0.14a/server.c
@@ -38,7 +38,6 @@
 #include <string.h>
 #include <ctype.h>
 #include <xmms/util.h>
-#include <sys/utsname.h>
 #include <stdarg.h>
 #include <errno.h>
 
@@ -480,16 +479,17 @@
 make_http_get(gchar *query)
 {
 	gchar *p = query;
-	struct utsname uts;
 	/*\ Substitute spaces with pluses \*/
 	while (*p) {
 		if (isspace(*p)) *p = '+';
 		p++;
 	}
-	uname(&uts);
-	p = g_strdup_printf("GET %s?cmd=%s&hello=%s+%s+" PACKAGE "+" VERSION
-			"&proto=1 HTTP/1.0\n\n", cd_cfg.cddb_cgi, query,
-			g_get_user_name(), uts.nodename);
+	/* we don't send current user/host name to prevent spam
+	 * software that sends this is considered spyware
+	 * that most people don't like
+	 */
+	p = g_strdup_printf("GET %s?cmd=%s&hello=unknown+localhost+" PACKAGE "+" VERSION
+			"&proto=1 HTTP/1.0\n\n", cd_cfg.cddb_cgi, query);
 	g_free(query);
 	return p;
 }
@@ -498,7 +498,6 @@
 cddbp_query_thread(void *arg)
 {
 	struct cddb_req *req = (struct cddb_req *)arg;
-	struct utsname uts;
 	gchar *l;
 
 	req->sock = tcp_connect(cd_cfg.cddb_server, cd_cfg.cddb_port);
@@ -514,9 +513,11 @@
 	}
 	g_free(l);
 
-	uname(&uts);
-	l = g_strdup_printf("cddb hello %s %s " PACKAGE " " VERSION "\n",
-				g_get_user_name(), uts.nodename);
+	/* we don't send current user/host name to prevent spam
+	 * software that sends this is considered spyware
+	 * that most people don't like
+	 */
+	l = g_strdup("cddb hello unknown localhost " PACKAGE " " VERSION "\n");
 	if (write_line(req->sock, l) < 0)
 		return end_req(req);
 	l = read_line(req);
@@ -530,15 +531,19 @@
 
 	l = req->query;
 	req->query = 0;
-	if (write_line(req->sock, l) < 0)
+	if (write_line(req->sock, l) < 0) {
+		g_free(l);
 		return end_req(req);
+	}
 
 	l = cddb_parse_query(req);
 	if (!l) return end_req(req);
 
-	if (write_line(req->sock, l) < 0)
+	if (write_line(req->sock, l) < 0) {
+		g_free(l);
 		return end_req(req);
-
+	}
+	
 	return cddb_save_query(req);
 }
 
--- xmms-cdread-0.14a.orig/.cvsignore
+++ xmms-cdread-0.14a/.cvsignore
@@ -0,0 +1,9 @@
+Makefile
+Makefile.in
+.deps
+.libs
+libtool
+config.cache config.log config.status
+*-stamp
+*.lo
+*.la
--- xmms-cdread-0.14a.orig/cdread.c
+++ xmms-cdread-0.14a/cdread.c
@@ -34,6 +34,7 @@
 #include <sys/ioctl.h>
 #include <errno.h>
 #include <xmms/util.h>
+#include <endian.h>
 
 #include "cdread.h"
 
@@ -309,12 +310,21 @@
 				break;
 			}
 			cur_lba += btw;
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+			/* Convert CDDA input from little-endian to native: */
+			for(i = 0; i < btw * CD_FRAMESIZE_RAW; i += 2) {
+				gchar tmp = buf[i];
+				buf[i] = buf[i+1];
+				buf[i+1] = tmp;
+			}
+#endif
 			cd_filter(buf, btw * (CD_FRAMESIZE_RAW / 4));
 			for (i = 0; i < btw; i++) {
 				cd_ip.output->write_audio(buf + (i *
 					CD_FRAMESIZE_RAW), CD_FRAMESIZE_RAW);
 				cd_ip.add_vis_pcm(cd_ip.output->written_time(),
-					FMT_S16_LE, 2, CD_FRAMESIZE_RAW,
+					FMT_S16_NE, 2, CD_FRAMESIZE_RAW,
 					buf + (i * CD_FRAMESIZE_RAW));
 			}
 		} else {
@@ -376,6 +386,7 @@
 	CD_UNLOCK();
 }
 
+/* Duplicate function, because libtool won't pass -nostdlib:
 void
 _fini(void)
 {
@@ -387,6 +398,7 @@
 	while (running_threads > 0)
 		xmms_usleep(10000);
 }
+*/
 
 static void
 cd_init(void)
@@ -531,7 +543,7 @@
 	}
 	cd_ip.get_volume = NULL;
 	cd_ip.set_volume = NULL;
-	if (!cd_ip.output->open_audio(FMT_S16_LE, 44100, 2)) {
+	if (!cd_ip.output->open_audio(FMT_S16_NE, 44100, 2)) {
 		cd->error = TRUE;
 	} else {
 		action_wait(cd, CD_TRACK);
@@ -555,7 +567,7 @@
 		CD_UNLOCK();
 		return -1;
 	}
-	r = cd_ip.output->continue_audio(FMT_S16_LE, 44100, 2);
+	r = cd_ip.output->continue_audio(FMT_S16_NE, 44100, 2);
 	if (r < 0) {
 		CD_UNLOCK();
 		return -1;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin