Common subdirectories: mpg123/CVS and mpg123-mine/CVS diff -u mpg123/common.c mpg123-mine/common.c --- mpg123/common.c 2001-05-17 00:56:56.000000000 +0800 +++ mpg123-mine/common.c 2003-07-08 11:00:45.000000000 +0800 @@ -868,7 +868,7 @@ if(rds->filelen >= 0) { long t = rds->tell(rds); rno = (int)((double)(rds->filelen-t)/bpf); - sno = (int)((double)t/bpf); +// sno = (int)((double)t/bpf); } sprintf(outbuf+strlen(outbuf),"\rFrame# %5d [%5d], ",sno,rno); diff -u mpg123/control_generic.c mpg123-mine/control_generic.c --- mpg123/control_generic.c 2001-01-23 23:10:02.000000000 +0800 +++ mpg123-mine/control_generic.c 2003-07-08 11:15:15.000000000 +0800 @@ -96,9 +96,10 @@ rno = 0; sno = no; if (rd->filelen >= 0) { - long t = rd->tell(rd); +// long t = rd->tell(rd); + long t = sno*bpf; rno = (int)((double)(rd->filelen-t)/bpf); - sno = (int)((double)t/bpf); +// sno = (int)((double)t/bpf); } tim1 = sno * tpf - dt; tim2 = rno * tpf + dt; diff -u mpg123/httpget.c mpg123-mine/httpget.c --- mpg123/httpget.c 2000-10-31 01:45:12.000000000 +0800 +++ mpg123-mine/httpget.c 2003-07-08 11:10:57.000000000 +0800 @@ -223,7 +223,7 @@ char *httpauth = NULL; char httpauth1[256]; -int http_open (char *url) +int http_open (char *url, int* length) { char *purl, *host, *request, *sptr; int linelength; @@ -430,6 +430,11 @@ readstring (request, linelength-1, myfile); if (!strncmp(request, "Location:", 9)) strncpy (purl, request+10, 1023); + if (!strncmp(request, "Content-Length:", 15)) + { + // Get the length. + *length = atoi(request+16); + } } while (request[0] != '\r' && request[0] != '\n'); } while (relocate && purl[0] && numrelocs++ < 5); if (relocate) { Common subdirectories: mpg123/jukebox and mpg123-mine/jukebox Only in mpg123-mine/: mpg123 diff -u mpg123/mpg123.h mpg123-mine/mpg123.h --- mpg123/mpg123.h 2001-01-24 01:58:28.000000000 +0800 +++ mpg123-mine/mpg123.h 2003-07-08 11:07:41.000000000 +0800 @@ -292,7 +292,7 @@ extern char *proxyurl; extern unsigned long proxyip; -extern int http_open (char *url); +extern int http_open (char *url, int* length); extern char *httpauth; /* ------ Declarations from "common.c" ------ */ Common subdirectories: mpg123/mpglib and mpg123-mine/mpglib diff -u mpg123/playlist.c mpg123-mine/playlist.c --- mpg123/playlist.c 2000-10-25 19:05:26.000000000 +0800 +++ mpg123-mine/playlist.c 2003-07-08 11:09:08.000000000 +0800 @@ -46,6 +46,7 @@ char linetmp [1024]; char * slashpos; int i; + int inetlen; /* Get playlist dirname to append it to the files in playlist */ if (playlist->listname) { @@ -62,14 +63,14 @@ } else if (!strncasecmp(playlist->listname, "http://", 7)) { int fd; - fd = http_open(playlist->listname); + fd = http_open(playlist->listname, &inetlen); if(fd < 0) return 0; playlist->listfile = fdopen(fd,"r"); } else if (!strncasecmp(playlist->listname, "ftp://", 6)) { int fd; - fd = http_open(playlist->listname); + fd = http_open(playlist->listname, &inetlen); if(fd < 0) return 0; playlist->listfile = fdopen(fd,"r"); Common subdirectories: mpg123/precompiled and mpg123-mine/precompiled diff -u mpg123/readers.c mpg123-mine/readers.c --- mpg123/readers.c 2000-10-31 04:12:59.000000000 +0800 +++ mpg123-mine/readers.c 2003-07-08 11:07:07.000000000 +0800 @@ -555,6 +555,7 @@ int i; int filept_opened = 1; int filept; + int inetlen = 0; if (!bs_filenam) { if(fd < 0) { @@ -565,9 +566,9 @@ filept = fd; } else if (!strncasecmp(bs_filenam, "http://", 7)) - filept = http_open(bs_filenam); + filept = http_open(bs_filenam, &inetlen); else if (!strncasecmp(bs_filenam, "ftp://", 6)) - filept = http_open(bs_filenam); + filept = http_open(bs_filenam, &inetlen); #ifndef O_BINARY #define O_BINARY (0) @@ -580,6 +581,7 @@ rd = NULL; for(i=0;;i++) { readers[i].filelen = -1; +// readers[i].filelen = 6300000; readers[i].filept = filept; readers[i].flags = 0; if(filept_opened) @@ -598,6 +600,10 @@ print_id3_tag(rd->id3buf); } + if (inetlen) { + rd->filelen = inetlen; + } + return rd; } Common subdirectories: mpg123/tools and mpg123-mine/tools