src/audio/SDL_wave.c
branchgsoc2008_nds
changeset 2669 e27bdcc80744
parent 2012 575d5c9d4db8
child 2859 99210400e8b9
equal deleted inserted replaced
2668:bb3241de289e 2669:e27bdcc80744
   460             was_error = 1;
   460             was_error = 1;
   461             goto done;
   461             goto done;
   462         }
   462         }
   463         /* 2 Uint32's for chunk header+len, plus the lenread */
   463         /* 2 Uint32's for chunk header+len, plus the lenread */
   464         headerDiff += lenread + 2 * sizeof(Uint32);
   464         headerDiff += lenread + 2 * sizeof(Uint32);
   465     }
   465     } while ((chunk.magic == FACT) || (chunk.magic == LIST));
   466     while ((chunk.magic == FACT) || (chunk.magic == LIST));
       
   467 
   466 
   468     /* Decode the audio data format */
   467     /* Decode the audio data format */
   469     format = (WaveFMT *) chunk.data;
   468     format = (WaveFMT *) chunk.data;
   470     if (chunk.magic != FMT) {
   469     if (chunk.magic != FMT) {
   471         SDL_SetError("Complex WAVE files not supported");
   470         SDL_SetError("Complex WAVE files not supported");
   562         }
   561         }
   563         *audio_len = lenread;
   562         *audio_len = lenread;
   564         *audio_buf = chunk.data;
   563         *audio_buf = chunk.data;
   565         if (chunk.magic != DATA)
   564         if (chunk.magic != DATA)
   566             headerDiff += lenread + 2 * sizeof(Uint32);
   565             headerDiff += lenread + 2 * sizeof(Uint32);
   567     }
   566     } while (chunk.magic != DATA);
   568     while (chunk.magic != DATA);
       
   569     headerDiff += 2 * sizeof(Uint32);   /* for the data chunk and len */
   567     headerDiff += 2 * sizeof(Uint32);   /* for the data chunk and len */
   570 
   568 
   571     if (MS_ADPCM_encoded) {
   569     if (MS_ADPCM_encoded) {
   572         if (MS_ADPCM_decode(audio_buf, audio_len) < 0) {
   570         if (MS_ADPCM_decode(audio_buf, audio_len) < 0) {
   573             was_error = 1;
   571             was_error = 1;