[xiph-cvs] cvs commit: vorbis-tools/oggenc audio.c

Michael Smith msmith at xiph.org
Sat Jan 18 06:37:22 PST 2003



msmith      03/01/18 09:37:22

  Modified:    oggenc   audio.c
  Log:
  Some fixes from Stan for the input format detection code in oggenc.

Revision  Changes    Path
1.30      +5 -6      vorbis-tools/oggenc/audio.c

Index: audio.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/audio.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- audio.c	7 Nov 2002 10:18:32 -0000	1.29
+++ audio.c	18 Jan 2003 14:37:21 -0000	1.30
@@ -57,23 +57,22 @@
                         buf_size = size;
                 }
 
-		if(buf_size > buf_filled)
+		if(size > buf_filled)
                 {
                         ret = fread(buf+buf_filled, 1, buf_size-buf_filled, in);
                         buf_filled += ret;
 
-			if(buf_filled != buf_size)
+			if(buf_filled < size)
                         { /* File truncated */
-				buf_size = buf_filled;
                                 j++;
                                 continue;
                         }
                 }
 
-		if(formats[j].id_func(buf, size))
+		if(formats[j].id_func(buf, buf_filled))
                 {
                         /* ok, we now have something that can handle the file */
-			if(formats[j].open_func(in, opt, buf, size)) {
+			if(formats[j].open_func(in, opt, buf, buf_filled)) {
                 free(buf);
                                 return &formats[j];
             }
@@ -720,7 +719,7 @@
     int i;
 
     for(i=0; i < in_samples; i++) {
-        buffer[0][i] = (d->bufs[0][i] + d->bufs[1][i])*0.5;
+        buffer[0][i] = (d->bufs[0][i] + d->bufs[1][i])*0.5f;
     }
 
     return in_samples;

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list