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

Michael Smith msmith at xiph.org
Mon Dec 3 06:48:05 PST 2001



msmith      01/12/03 06:48:05

  Modified:    oggenc   audio.c
  Log:
  Get previous bugfix right (duh).

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

Index: audio.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/audio.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- audio.c	2001/12/03 14:42:44	1.17
+++ audio.c	2001/12/03 14:48:04	1.18
@@ -430,9 +430,8 @@
                 wav->samplesize = format.samplesize;
 
                 if(len)
-		{
+        {
                         opt->total_samples_per_channel = len/(format.channels*samplesize);
-			wav->totalsamples = len/(format.channels*samplesize);
                 }
                 else
                 {
@@ -441,15 +440,16 @@
                         if(fseek(in, 0, SEEK_END) == -1)
                         {
                                 opt->total_samples_per_channel = 0; /* Give up */
-				wav->totalsamples = 0;
                         }
                         else
                         {
-				opt->total_samples_per_channel = (ftell(in) - pos)/(format.channels*samplesize);
-				wav->totalsamples = len/(format.channels*samplesize);
+				opt->total_samples_per_channel = (ftell(in) - pos)/
+                    (format.channels*samplesize);
                                 fseek(in,pos, SEEK_SET);
                         }
                 }
+		wav->totalsamples = opt->total_samples_per_channel;
+
                 opt->readdata = (void *)wav;
                 return 1;
         }

--- >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