summaryrefslogtreecommitdiff
path: root/apps/plugins/sdl/src
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/sdl/src')
-rw-r--r--apps/plugins/sdl/src/audio/SDL_wave.c9
-rw-r--r--apps/plugins/sdl/src/video/SDL_gamma.c18
2 files changed, 14 insertions, 13 deletions
diff --git a/apps/plugins/sdl/src/audio/SDL_wave.c b/apps/plugins/sdl/src/audio/SDL_wave.c
index b4ad6c7876..21a7260be3 100644
--- a/apps/plugins/sdl/src/audio/SDL_wave.c
+++ b/apps/plugins/sdl/src/audio/SDL_wave.c
@@ -125,7 +125,7 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
125 encoded_len = *audio_len; 125 encoded_len = *audio_len;
126 encoded = *audio_buf; 126 encoded = *audio_buf;
127 freeable = *audio_buf; 127 freeable = *audio_buf;
128 *audio_len = (encoded_len/MS_ADPCM_state.wavefmt.blockalign) * 128 *audio_len = (encoded_len/MS_ADPCM_state.wavefmt.blockalign) *
129 MS_ADPCM_state.wSamplesPerBlock* 129 MS_ADPCM_state.wSamplesPerBlock*
130 MS_ADPCM_state.wavefmt.channels*sizeof(Sint16); 130 MS_ADPCM_state.wavefmt.channels*sizeof(Sint16);
131 *audio_buf = (Uint8 *)SDL_malloc(*audio_len); 131 *audio_buf = (Uint8 *)SDL_malloc(*audio_len);
@@ -340,7 +340,7 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
340 encoded_len = *audio_len; 340 encoded_len = *audio_len;
341 encoded = *audio_buf; 341 encoded = *audio_buf;
342 freeable = *audio_buf; 342 freeable = *audio_buf;
343 *audio_len = (encoded_len/IMA_ADPCM_state.wavefmt.blockalign) * 343 *audio_len = (encoded_len/IMA_ADPCM_state.wavefmt.blockalign) *
344 IMA_ADPCM_state.wSamplesPerBlock* 344 IMA_ADPCM_state.wSamplesPerBlock*
345 IMA_ADPCM_state.wavefmt.channels*sizeof(Sint16); 345 IMA_ADPCM_state.wavefmt.channels*sizeof(Sint16);
346 *audio_buf = (Uint8 *)SDL_malloc(*audio_len); 346 *audio_buf = (Uint8 *)SDL_malloc(*audio_len);
@@ -413,7 +413,9 @@ SDL_AudioSpec * SDL_LoadWAV_RW (SDL_RWops *src, int freesrc,
413 was_error = 1; 413 was_error = 1;
414 goto done; 414 goto done;
415 } 415 }
416 416 chunk.data = NULL;
417 chunk.length = 0;
418
417 /* Check the magic header */ 419 /* Check the magic header */
418 RIFFchunk = SDL_ReadLE32(src); 420 RIFFchunk = SDL_ReadLE32(src);
419 wavelen = SDL_ReadLE32(src); 421 wavelen = SDL_ReadLE32(src);
@@ -432,7 +434,6 @@ SDL_AudioSpec * SDL_LoadWAV_RW (SDL_RWops *src, int freesrc,
432 headerDiff += sizeof(Uint32); /* for WAVE */ 434 headerDiff += sizeof(Uint32); /* for WAVE */
433 435
434 /* Read the audio data format chunk */ 436 /* Read the audio data format chunk */
435 chunk.data = NULL;
436 do { 437 do {
437 if ( chunk.data != NULL ) { 438 if ( chunk.data != NULL ) {
438 SDL_free(chunk.data); 439 SDL_free(chunk.data);
diff --git a/apps/plugins/sdl/src/video/SDL_gamma.c b/apps/plugins/sdl/src/video/SDL_gamma.c
index 4fd037019f..c820620b5c 100644
--- a/apps/plugins/sdl/src/video/SDL_gamma.c
+++ b/apps/plugins/sdl/src/video/SDL_gamma.c
@@ -29,10 +29,10 @@
29/* Math routines from uClibc: http://www.uclibc.org */ 29/* Math routines from uClibc: http://www.uclibc.org */
30#include "math_private.h" 30#include "math_private.h"
31#include "e_sqrt.h" 31#include "e_sqrt.h"
32#include "e_pow.h" 32//#include "e_pow.h"
33#include "e_log.h" 33//#include "e_log.h"
34#define pow(x, y) __ieee754_pow(x, y) 34//#define pow(x, y) __ieee754_pow(x, y)
35#define log(x) __ieee754_log(x) 35//#define log(x) __ieee754_log(x)
36#endif 36#endif
37 37
38#include "SDL_sysvideo.h" 38#include "SDL_sysvideo.h"
@@ -94,7 +94,7 @@ int SDL_SetGamma(float red, float green, float blue)
94{ 94{
95 int succeeded; 95 int succeeded;
96 SDL_VideoDevice *video = current_video; 96 SDL_VideoDevice *video = current_video;
97 SDL_VideoDevice *this = current_video; 97 SDL_VideoDevice *this = current_video;
98 98
99 succeeded = -1; 99 succeeded = -1;
100 /* Prefer using SetGammaRamp(), as it's more flexible */ 100 /* Prefer using SetGammaRamp(), as it's more flexible */
@@ -120,7 +120,7 @@ int SDL_GetGamma(float *red, float *green, float *blue)
120{ 120{
121 int succeeded; 121 int succeeded;
122 SDL_VideoDevice *video = current_video; 122 SDL_VideoDevice *video = current_video;
123 SDL_VideoDevice *this = current_video; 123 SDL_VideoDevice *this = current_video;
124 124
125 succeeded = -1; 125 succeeded = -1;
126 /* Prefer using GetGammaRamp(), as it's more flexible */ 126 /* Prefer using GetGammaRamp(), as it's more flexible */
@@ -145,7 +145,7 @@ int SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue)
145{ 145{
146 int succeeded; 146 int succeeded;
147 SDL_VideoDevice *video = current_video; 147 SDL_VideoDevice *video = current_video;
148 SDL_VideoDevice *this = current_video; 148 SDL_VideoDevice *this = current_video;
149 SDL_Surface *screen = SDL_PublicSurface; 149 SDL_Surface *screen = SDL_PublicSurface;
150 150
151 /* Verify the screen parameter */ 151 /* Verify the screen parameter */
@@ -177,7 +177,7 @@ int SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue)
177 /* If physical palette has been set independently, use it */ 177 /* If physical palette has been set independently, use it */
178 if(video->physpal) 178 if(video->physpal)
179 pal = video->physpal; 179 pal = video->physpal;
180 180
181 SDL_SetPalette(screen, SDL_PHYSPAL, 181 SDL_SetPalette(screen, SDL_PHYSPAL,
182 pal->colors, 0, pal->ncolors); 182 pal->colors, 0, pal->ncolors);
183 return 0; 183 return 0;
@@ -196,7 +196,7 @@ int SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue)
196int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue) 196int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue)
197{ 197{
198 SDL_VideoDevice *video = current_video; 198 SDL_VideoDevice *video = current_video;
199 SDL_VideoDevice *this = current_video; 199 SDL_VideoDevice *this = current_video;
200 200
201 /* Lazily allocate the gamma table */ 201 /* Lazily allocate the gamma table */
202 if ( ! video->gamma ) { 202 if ( ! video->gamma ) {