1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-04 01:48:54 +00:00
freebsd-ports/audio/shout/files/patch-shout.c
Edwin Groothuis f03d49db1a Bug in audio/shout when using with SHOUTcast Server 1.9.2
Shout is streaming client for icecast and shoutcast streaming
	servers.  It works well with SHOUTcast Server Version
	1.9.2/FreeBSD4 (with -i key (Use old icy headers)),But if
	you try to enable title streaming (-t key) (without it
	clients don't see what song is playing). There are two
	problems why it doesn't work:

	1. By default shoutcast expects source stremer connection
	on 8001 port, and listeners on 8000 port. (steamer port is
	listener_port+1). Shout streams mp3 music on port 8001 (from
	config file or command line), but title streaming is done
	on listener port through web admin interface.
	(http://server:port//admin.cgi?pass=password&;mode=updinfo&song=Song
	Title) Without patch shout tries to update info on streamer,
	and not listener port and this doesn't work. I attached
	patch which reduces port number by one, which is right
	(listener) port number.

	2. With this fix shout connects to right port, but still
	doesn't update song title. From shoutcast documentation
	I've found that now shoutcast accepts update post (see
	above) only with useragent Mozilla ant shout gives useragent
	Shout/0.8.0.

Informed maintainer

PR:		ports/48771
Submitted by:	Justas Gurinavicius <raktas@raktas.net>
2003-09-01 03:06:48 +00:00

21 lines
1.1 KiB
C

--- shout.c.orig Thu Apr 20 00:31:50 2000
+++ shout.c Sun Aug 31 19:59:41 2003
@@ -1738,7 +1738,7 @@
void
update_meta_info_on_server (char *filename, unsigned long int size)
{
- sock_t sockfd = sock_connect (set.servername, set.port);
+ sock_t sockfd = sock_connect (set.servername, set.port-1);
char title[BUFSIZE]; /* copy of filename */
char *song = NULL;
char *mount = NULL;
@@ -1815,7 +1815,7 @@
if (sockfd != -1) {
if (set.use_icy) {
- sock_write (sockfd, "GET /admin.cgi?pass=%s&mode=updinfo&song=%s HTTP/1.0\nHost: %s:%d\nUser-Agent: Shout/%s\n\n", set.password, url_encode (titleptr, &song), set.servername, set.port, VERSION);
+ sock_write (sockfd, "GET /admin.cgi?pass=%s&mode=updinfo&song=%s HTTP/1.0\nHost: %s:%d\nUser-Agent: Mozilla(Shout/%s)\n\n", set.password, url_encode (titleptr, &song), set.servername, set.port, VERSION);
} else {
sock_write (sockfd, "GET /admin.cgi?pass=%s&mode=updinfo&mount=%s&song=%s&length=%ld HTTP/1.0\nHost: %s:%d\nUser-Agent: Shout/%s\n\n", set.password, url_encode (set.mount_name, &mount), url_encode (titleptr, &song), size, set.servername, set.port, VERSION);
if (mount)