[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Patch for mpg123-0.59o



Doh!  Forgot the patch...

On Mon, 19 Oct 1998, Bob McElrath wrote:

> Attached is a patch for mpg123-0.59o that does the following:
> 
> 1) Fixes minor compiler warnings about main not returning int, and some data
> 	type mismatches.
> 
> 2) Changes Makefile to use Memory Mapped I/O on alpha.
> 
> 3) Fixes common.c/open_stream(...) so that it correctly sets the
> 	readers[i].filelen variable.  The most important consequence of this
> 	is that now mpg123 outputs Frame and Time info with the -v option. 
> 	(And hence, now works with gqmpeg)
> 
> If you didn't catch that, this makes mpg123 work with gqmpeg.  :)  For you
> alpha people, you can get binaries for both off my computer:
> 	ftp://draal.physics.wisc.edu/pub/mp3
> mpg123 uses about 3% of my processor on a 533MHz 164LX.  ;)
> 
> Is mpg123 still maintained?  The last release was in Febuary...and it seems
> to have lots of bugs that still need to be beat on...
> 
> -- Bob
> 
>   ./'^`\._./'~`\._./'~`\._./'~`\._./'#`\._./'~`\._./'~`\._./'~`\._./'^`\.
>  / Rube Goldberg? Bah! Amateur! I give you..Windows 98! Linux everywhere \ 
> | Linux, because everyone's work is mission critical.   ANYTHING inside.  |
> |_Bob McElrath (mcelrath@wisconsin.cern.ch) Univ. of Wisconsin at Madison_|
>   \.___________________________________________________________________./
> 
> 

-- Bob

  ./'^`\._./'~`\._./'~`\._./'~`\._./'#`\._./'~`\._./'~`\._./'~`\._./'^`\.
 / Rube Goldberg? Bah! Amateur! I give you..Windows 98! Linux everywhere \ 
| Linux, because everyone's work is mission critical.   ANYTHING inside.  |
|_Bob McElrath (mcelrath@wisconsin.cern.ch) Univ. of Wisconsin at Madison_|
  \.___________________________________________________________________./
diff -ubr mpg123-0.59o.orig/Makefile mpg123-0.59o/Makefile
--- mpg123-0.59o.orig/Makefile	Sun Feb  8 12:23:04 1998
+++ mpg123-0.59o/Makefile	Mon Oct 19 03:00:09 1998
@@ -81,7 +81,7 @@
 
 linux-alpha:
 	$(MAKE) CC=gcc LDFLAGS= OBJECTS='decode.o dct64.o audio_oss.o' \
-		CFLAGS='-DLINUX -DOSS -Wall -O2 \
+		CFLAGS='-DLINUX -DOSS -DREAL_IS_FLOAT -DREAD_MMAP -Wall -O2 \
 			-fomit-frame-pointer -funroll-all-loops \
 			-finline-functions -ffast-math \
 			-Wall -O6 -DUSE_MMAP' \
diff -ubr mpg123-0.59o.orig/common.c mpg123-0.59o/common.c
--- mpg123-0.59o.orig/common.c	Wed Feb 11 15:36:25 1998
+++ mpg123-0.59o/common.c	Mon Oct 19 03:01:46 1998
@@ -4,6 +4,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <statbuf.h>
 #include <fcntl.h>
 
 #ifdef READ_MMAP
@@ -911,6 +912,8 @@
 void open_stream(char *bs_filenam,int fd)
 {
     int i;
+    int flen;
+    struct stat s;
     filept_opened = 1;
 
     if (!bs_filenam) {
@@ -927,9 +930,15 @@
 		perror (bs_filenam);
 		exit(1);
 	}
+    if(fstat(filept, &s) == -1) {
+      fprintf(stderr, "Error: fstat failed\n");
+      flen = -1;
+    } else {
+      flen = s.st_size;
+    }
 
     for(i=0;;i++) {
-      readers[i].filelen = -1;
+      readers[i].filelen = flen;
       if(!readers[i].init) {
         rd = &readers[i];
         break;
@@ -1142,7 +1151,7 @@
 
 	fprintf(stderr,"Time: %3.2f [%3.2f], ",tim1,tim2);
 	if(param.usebuffer)
-		fprintf(stderr,"[%8d] ",buffsize);
+		fprintf(stderr,"[%8ld] ",buffsize);
 }
 
 int get_songlen(struct frame *fr,int no)
diff -ubr mpg123-0.59o.orig/mpg123.c mpg123-0.59o/mpg123.c
--- mpg123-0.59o.orig/mpg123.c	Wed Feb 11 15:15:08 1998
+++ mpg123-0.59o/mpg123.c	Mon Oct 19 03:01:08 1998
@@ -639,7 +639,7 @@
 	}
 }
 
-void main(int argc, char *argv[])
+int main(int argc, char *argv[])
 {
 	int result;
 	unsigned long frameNum = 0;
@@ -655,7 +655,7 @@
 #endif
 
 	if(sizeof(short) != 2) {
-		fprintf(stderr,"Ouch SHORT has size of %d bytes (required: '2')\n",sizeof(short));
+		fprintf(stderr,"Ouch SHORT has size of %d bytes (required: '2')\n",(int)sizeof(short));
 		exit(1);
 	}
 

Reply to: