This commit is contained in:
Jonas Kulla 2014-09-12 06:42:18 +02:00
parent 0c318ee0b2
commit a365a7a754
1 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
diff -r 719dade41745 decoders/wav.c diff -r 719dade41745 decoders/wav.c
--- a/decoders/wav.c Wed Aug 15 23:52:18 2012 -0400 --- a/decoders/wav.c Wed Aug 15 23:52:18 2012 -0400
+++ b/decoders/wav.c Fri Sep 12 06:37:52 2014 +0200 +++ b/decoders/wav.c Fri Sep 12 06:42:05 2014 +0200
@@ -113,8 +113,9 @@ @@ -113,8 +113,9 @@
#define fmtID 0x20746D66 /* "fmt ", in ascii. */ #define fmtID 0x20746D66 /* "fmt ", in ascii. */
@ -52,7 +52,7 @@ diff -r 719dade41745 decoders/wav.c
/* put other format-specific data here... */ /* put other format-specific data here... */
} fmt; } fmt;
} fmt_t; } fmt_t;
@@ -614,6 +640,284 @@ @@ -614,6 +640,288 @@
/***************************************************************************** /*****************************************************************************
@ -161,6 +161,7 @@ diff -r 719dade41745 decoders/wav.c
+ return(1); + return(1);
+} /* read_ima_frameset */ +} /* read_ima_frameset */
+ +
+
+static Uint32 read_sample_fmt_ima(Sound_Sample *sample) +static Uint32 read_sample_fmt_ima(Sound_Sample *sample)
+{ +{
+ Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; + Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
@ -219,12 +220,14 @@ diff -r 719dade41745 decoders/wav.c
+ return(bw); + return(bw);
+} /* read_sample_fmt_ima */ +} /* read_sample_fmt_ima */
+ +
+
+static void free_fmt_ima(fmt_t *fmt) +static void free_fmt_ima(fmt_t *fmt)
+{ +{
+ free(fmt->fmt.ima.d); + free(fmt->fmt.ima.d);
+ free(fmt->fmt.ima.buf); + free(fmt->fmt.ima.buf);
+} /* free_fmt_ima */ +} /* free_fmt_ima */
+ +
+
+static int rewind_sample_fmt_ima(Sound_Sample *sample) +static int rewind_sample_fmt_ima(Sound_Sample *sample)
+{ +{
+ Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; + Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
@ -296,6 +299,7 @@ diff -r 719dade41745 decoders/wav.c
+ return(1); /* success. */ + return(1); /* success. */
+} /* seek_sample_fmt_ima */ +} /* seek_sample_fmt_ima */
+ +
+
+static int read_fmt_ima(SDL_RWops *rw, fmt_t *fmt) +static int read_fmt_ima(SDL_RWops *rw, fmt_t *fmt)
+{ +{
+ Uint16 chan = fmt->wChannels; + Uint16 chan = fmt->wChannels;
@ -337,7 +341,7 @@ diff -r 719dade41745 decoders/wav.c
* Everything else... * * Everything else... *
*****************************************************************************/ *****************************************************************************/
@@ -642,6 +946,13 @@ @@ -642,6 +950,13 @@
SNDDBG(("WAV: Appears to be ADPCM compressed audio.\n")); SNDDBG(("WAV: Appears to be ADPCM compressed audio.\n"));
return(read_fmt_adpcm(rw, fmt)); return(read_fmt_adpcm(rw, fmt));