diff -ru mpg123/httpget.c mpg123-shoutcast/httpget.c
--- mpg123/httpget.c	2000-10-30 18:45:12.000000000 +0100
+++ mpg123-shoutcast/httpget.c	2003-12-09 09:21:45.000000000 +0100
@@ -217,6 +217,8 @@
 char *proxyurl = NULL;
 unsigned long proxyip = 0;
 unsigned char *proxyport;
+int icy_meta = 0;
+int icy_count = 0;
 
 #define ACCEPT_HEAD "Accept: audio/mpeg, audio/x-mpegurl, */*\r\n"
 
@@ -333,7 +335,7 @@
 			strcat (request, sptr);
 		}
 		sprintf (request + strlen(request),
-			" HTTP/1.0\r\nUser-Agent: %s/%s\r\n",
+			" HTTP/1.0\r\nUser-Agent: %s/%s\r\nIcy-MetaData:1\r\n",
 			prgName, prgVersion);
 		if (host) {
 			sprintf(request + strlen(request),
@@ -430,6 +432,16 @@
 			readstring (request, linelength-1, myfile);
 			if (!strncmp(request, "Location:", 9))
 				strncpy (purl, request+10, 1023);
+			else if (!strncmp(request, "icy-name:", 9))
+				fprintf(stderr, "\nShoutcast/Icecast Name: %s",
+request+10);
+			else if (!strncmp(request, "icy-genre:", 10))
+				fprintf(stderr, "Shoutcast/Icecast Genre: %s", request+10);
+			else if (!strncmp(request, "icy-url:", 8))
+				fprintf(stderr, "Shoutcast/Icecast URL: %s", request+8);
+			else if (!strncmp(request, "icy-metaint:", 12))
+				icy_meta = atoi(request+12);
+                
 		} while (request[0] != '\r' && request[0] != '\n');
 	} while (relocate && purl[0] && numrelocs++ < 5);
 	if (relocate) {
diff -ru mpg123/mpg123.h mpg123-shoutcast/mpg123.h
--- mpg123/mpg123.h	2001-01-23 18:58:28.000000000 +0100
+++ mpg123-shoutcast/mpg123.h	2003-12-09 09:20:52.000000000 +0100
@@ -290,6 +290,8 @@
 
 /* ------ Declarations from "httpget.c" ------ */
 
+extern int icy_meta;
+extern int icy_count;
 extern char *proxyurl;
 extern unsigned long proxyip;
 extern int http_open (char *url);
diff -ru mpg123/readers.c mpg123-shoutcast/readers.c
--- mpg123/readers.c	2000-10-30 21:12:59.000000000 +0100
+++ mpg123-shoutcast/readers.c	2003-12-09 13:15:43.000000000 +0100
@@ -15,6 +15,8 @@
 #endif
 #endif
 
+char *icy_song = NULL;
+
 static int get_fileinfo(struct reader *,char *buf);
 static void readers_add_data(struct reader *rds,unsigned char *buf,int len);
 
@@ -60,6 +62,68 @@
              rds->bufstart = rds->bufpos;
         }
         else {
+          if (icy_meta > 0 && icy_count == icy_meta) {
+            char length_byte = 0;
+
+            read(fd, &length_byte, 1);
+ 
+            if(length_byte > 0) {
+              unsigned char *metabuf, *p, *s;
+              int meta_len, mcnt = 0;
+ 
+              meta_len = length_byte*16;
+              
+              if((metabuf = (char*)calloc(meta_len, sizeof(char))) == NULL) {
+                fprintf(stderr, "No memory! :(\n");
+                exit(1);
+              }
+
+              memset(metabuf, 0, meta_len);
+
+              while(mcnt < meta_len) {
+                ret = read(fd, metabuf+mcnt, meta_len-mcnt);
+                if(ret < 0)
+                  return ret;
+                if(ret == 0)
+                  break;
+                mcnt += ret;
+              }
+
+              if((p = strstr(metabuf, "StreamTitle="))) {
+                int plen;
+                s = strchr(p, ';');
+                if(*(s-1) == '\'')
+                  *(s-1)='\0';
+                else
+                  *s='\0';
+                if(p[12] == '\'')
+                  p+=13;
+                else
+                  p+=12;
+
+                if(p && (plen = strlen(p)) > 0)
+                  if(icy_song && strncmp(p, icy_song, plen)) {
+                    free(icy_song);
+                    icy_song = NULL;
+                  }
+                  if(!icy_song) {
+                    if((icy_song = (char*)calloc(plen, sizeof(char))))
+                      strncpy(icy_song, p, plen);
+                      fprintf(stderr, "* %s\n", icy_song);
+                  }
+              }
+
+              free(metabuf);
+           }
+
+          icy_count = 0;
+
+          }
+          
+          if(icy_meta > 0 && icy_count+toread > icy_meta) {
+            toread = icy_meta-icy_count; 
+          }
+
 	  ret = read(fd,buf+cnt,toread);
 
 	  if(ret < 0)
@@ -67,6 +131,9 @@
 	  if(ret == 0)
 	    break;
 
+          if(icy_meta > 0)
+            icy_count+=ret;
+
           if(rds->mark) {
             readers_add_data(rds,buf+cnt,ret);
             rds->bufpos = rds->bufend;

