shithub: aacdec

Download patch

ref: da29a5eefaff382ce76c4f7ff41003b2d5280584
parent: eb346839313b5a5ff4c863574ce8a10d09e0b309
author: menno <menno>
date: Wed Aug 21 12:23:15 EDT 2002

small changes to audio writing

--- a/frontend/audio.c
+++ b/frontend/audio.c
@@ -1,22 +1,22 @@
 /*
 ** FAAD - Freeware Advanced Audio Decoder
 ** Copyright (C) 2002 M. Bakker
-**  
+**
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
 ** the Free Software Foundation; either version 2 of the License, or
 ** (at your option) any later version.
-** 
+**
 ** This program is distributed in the hope that it will be useful,
 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ** GNU General Public License for more details.
-** 
+**
 ** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: audio.c,v 1.8 2002/08/17 11:17:39 menno Exp $
+** $Id: audio.c,v 1.9 2002/08/21 16:23:15 menno Exp $
 **/
 
 #ifdef _WIN32
@@ -39,7 +39,7 @@
 
     aufile->samplerate = samplerate;
     aufile->channels = channels;
-    aufile->samples = 0;
+    aufile->total_samples = 0;
     aufile->fileType = fileType;
 
     switch (outputFormat)
@@ -99,7 +99,7 @@
         return 0;
     }
 
-	return 0;
+    return 0;
 }
 
 void close_audio_file(audio_file *aufile)
@@ -121,7 +121,7 @@
     unsigned char header[44];
     unsigned char* p = header;
     unsigned int bytes = (aufile->bits_per_sample + 7) / 8;
-    float data_size = (float)bytes * aufile->samples;
+    float data_size = (float)bytes * aufile->total_samples;
     unsigned long word32;
 
     *p++ = 'R'; *p++ = 'I'; *p++ = 'F'; *p++ = 'F';
@@ -187,7 +187,7 @@
     short *sample_buffer16 = (short*)sample_buffer;
     char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
 
-    aufile->samples += samples;
+    aufile->total_samples += samples;
 
     for (i = 0; i < samples; i++)
     {
@@ -210,7 +210,7 @@
     long *sample_buffer24 = (long*)sample_buffer;
     char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
 
-    aufile->samples += samples;
+    aufile->total_samples += samples;
 
     for (i = 0; i < samples; i++)
     {
@@ -234,7 +234,7 @@
     long *sample_buffer32 = (long*)sample_buffer;
     char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
 
-    aufile->samples += samples;
+    aufile->total_samples += samples;
 
     for (i = 0; i < samples; i++)
     {
@@ -259,7 +259,7 @@
     float *sample_buffer_f = (float*)sample_buffer;
     unsigned char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
 
-    aufile->samples += samples;
+    aufile->total_samples += samples;
 
     for (i = 0; i < samples; i++)
     {
--- a/frontend/audio.h
+++ b/frontend/audio.h
@@ -1,22 +1,22 @@
 /*
 ** FAAD - Freeware Advanced Audio Decoder
 ** Copyright (C) 2002 M. Bakker
-**  
+**
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
 ** the Free Software Foundation; either version 2 of the License, or
 ** (at your option) any later version.
-** 
+**
 ** This program is distributed in the hope that it will be useful,
 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ** GNU General Public License for more details.
-** 
+**
 ** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: audio.h,v 1.3 2002/08/14 10:55:28 menno Exp $
+** $Id: audio.h,v 1.4 2002/08/21 16:23:15 menno Exp $
 **/
 
 #ifndef AUDIO_H_INCLUDED
@@ -41,7 +41,7 @@
     unsigned long samplerate;
     unsigned int bits_per_sample;
     unsigned int channels;
-    unsigned long samples;
+    unsigned long total_samples;
 } audio_file;
 
 audio_file *open_audio_file(char *infile, int samplerate, int channels,