@@ -280,7 +280,7 @@ void ConvertAudio(int num_frames,
280
280
281
281
// swizzle input to "standard" format if necessary.
282
282
if (src_map ) {
283
- void * buf = scratch ? scratch : dst ; // use scratch if available, since it has to be big enough to hold src, unless it's NULL, then dst has to be.
283
+ void * buf = scratch ? scratch : dst ; // use scratch if available, since it has to be big enough to hold src, unless it's NULL, then dst has to be.
284
284
SwizzleAudio (num_frames , buf , src , src_channels , src_map , src_format );
285
285
src = buf ;
286
286
}
@@ -318,7 +318,7 @@ void ConvertAudio(int num_frames,
318
318
319
319
// get us to float format.
320
320
if (srcconvert ) {
321
- void * buf = (channelconvert || dstconvert ) ? scratch : dst ;
321
+ void * buf = (channelconvert || dstconvert ) ? scratch : dst ;
322
322
ConvertAudioToFloat ((float * ) buf , src , num_frames * src_channels , src_format );
323
323
src = buf ;
324
324
}
@@ -368,7 +368,7 @@ void ConvertAudio(int num_frames,
368
368
channel_converter = override ;
369
369
}
370
370
371
- void * buf = dstconvert ? scratch : dst ;
371
+ void * buf = dstconvert ? scratch : dst ;
372
372
channel_converter ((float * ) buf , (const float * ) src , num_frames );
373
373
src = buf ;
374
374
}
@@ -399,7 +399,7 @@ static int CalculateMaxFrameSize(SDL_AudioFormat src_format, int src_channels, S
399
399
return max_format_size * max_channels ;
400
400
}
401
401
402
- static Sint64 GetAudioStreamResampleRate (SDL_AudioStream * stream , int src_freq , Sint64 resample_offset )
402
+ static Sint64 GetAudioStreamResampleRate (SDL_AudioStream * stream , int src_freq , Sint64 resample_offset )
403
403
{
404
404
src_freq = (int )((float )src_freq * stream -> freq_ratio );
405
405
@@ -778,9 +778,9 @@ static bool CheckAudioStreamIsFullySetup(SDL_AudioStream *stream)
778
778
}
779
779
780
780
// you MUST hold `stream->lock` when calling this, and validate your parameters!
781
- static bool PutAudioStreamBufferInternal (SDL_AudioStream * stream , const SDL_AudioSpec * spec , const int * chmap , const void * buf , int len , SDL_ReleaseAudioBufferCallback callback , void * userdata )
781
+ static bool PutAudioStreamBufferInternal (SDL_AudioStream * stream , const SDL_AudioSpec * spec , const int * chmap , const void * buf , int len , SDL_ReleaseAudioBufferCallback callback , void * userdata )
782
782
{
783
- SDL_AudioTrack * track = NULL ;
783
+ SDL_AudioTrack * track = NULL ;
784
784
785
785
if (callback ) {
786
786
track = SDL_CreateAudioTrack (stream -> queue , spec , chmap , (Uint8 * )buf , len , len , callback , userdata );
@@ -809,7 +809,7 @@ static bool PutAudioStreamBufferInternal(SDL_AudioStream *stream, const SDL_Audi
809
809
return retval ;
810
810
}
811
811
812
- static bool PutAudioStreamBuffer (SDL_AudioStream * stream , const void * buf , int len , SDL_ReleaseAudioBufferCallback callback , void * userdata )
812
+ static bool PutAudioStreamBuffer (SDL_AudioStream * stream , const void * buf , int len , SDL_ReleaseAudioBufferCallback callback , void * userdata )
813
813
{
814
814
#if DEBUG_AUDIOSTREAM
815
815
SDL_Log ("AUDIOSTREAM: wants to put %d bytes" , len );
@@ -836,7 +836,7 @@ static bool PutAudioStreamBuffer(SDL_AudioStream *stream, const void *buf, int l
836
836
837
837
static void SDLCALL FreeAllocatedAudioBuffer (void * userdata , const void * buf , int len )
838
838
{
839
- SDL_free ((void * ) buf );
839
+ SDL_free ((void * ) buf );
840
840
}
841
841
842
842
bool SDL_PutAudioStreamData (SDL_AudioStream * stream , const void * buf , int len )
@@ -1081,8 +1081,8 @@ static Uint8 *EnsureAudioStreamWorkBufferSize(SDL_AudioStream *stream, size_t ne
1081
1081
return ptr ;
1082
1082
}
1083
1083
1084
- static Sint64 NextAudioStreamIter (SDL_AudioStream * stream , void * * inout_iter ,
1085
- Sint64 * inout_resample_offset , SDL_AudioSpec * out_spec , int * * out_chmap , bool * out_flushed )
1084
+ static Sint64 NextAudioStreamIter (SDL_AudioStream * stream , void * * inout_iter ,
1085
+ Sint64 * inout_resample_offset , SDL_AudioSpec * out_spec , int * * out_chmap , bool * out_flushed )
1086
1086
{
1087
1087
SDL_AudioSpec spec ;
1088
1088
bool flushed ;
@@ -1136,9 +1136,9 @@ static Sint64 NextAudioStreamIter(SDL_AudioStream* stream, void** inout_iter,
1136
1136
return output_frames ;
1137
1137
}
1138
1138
1139
- static Sint64 GetAudioStreamAvailableFrames (SDL_AudioStream * stream , Sint64 * out_resample_offset )
1139
+ static Sint64 GetAudioStreamAvailableFrames (SDL_AudioStream * stream , Sint64 * out_resample_offset )
1140
1140
{
1141
- void * iter = SDL_BeginAudioQueueIter (stream -> queue );
1141
+ void * iter = SDL_BeginAudioQueueIter (stream -> queue );
1142
1142
1143
1143
Sint64 resample_offset = stream -> resample_offset ;
1144
1144
Sint64 output_frames = 0 ;
@@ -1160,9 +1160,9 @@ static Sint64 GetAudioStreamAvailableFrames(SDL_AudioStream* stream, Sint64* out
1160
1160
return output_frames ;
1161
1161
}
1162
1162
1163
- static Sint64 GetAudioStreamHead (SDL_AudioStream * stream , SDL_AudioSpec * out_spec , int * * out_chmap , bool * out_flushed )
1163
+ static Sint64 GetAudioStreamHead (SDL_AudioStream * stream , SDL_AudioSpec * out_spec , int * * out_chmap , bool * out_flushed )
1164
1164
{
1165
- void * iter = SDL_BeginAudioQueueIter (stream -> queue );
1165
+ void * iter = SDL_BeginAudioQueueIter (stream -> queue );
1166
1166
1167
1167
if (!iter ) {
1168
1168
SDL_zerop (out_spec );
@@ -1178,8 +1178,8 @@ static Sint64 GetAudioStreamHead(SDL_AudioStream* stream, SDL_AudioSpec* out_spe
1178
1178
// Enough input data MUST be available!
1179
1179
static bool GetAudioStreamDataInternal (SDL_AudioStream * stream , void * buf , int output_frames , float gain )
1180
1180
{
1181
- const SDL_AudioSpec * src_spec = & stream -> input_spec ;
1182
- const SDL_AudioSpec * dst_spec = & stream -> dst_spec ;
1181
+ const SDL_AudioSpec * src_spec = & stream -> input_spec ;
1182
+ const SDL_AudioSpec * dst_spec = & stream -> dst_spec ;
1183
1183
1184
1184
const SDL_AudioFormat src_format = src_spec -> format ;
1185
1185
const int src_channels = src_spec -> channels ;
@@ -1199,7 +1199,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
1199
1199
1200
1200
// Not resampling? It's an easy conversion (and maybe not even that!)
1201
1201
if (resample_rate == 0 ) {
1202
- Uint8 * work_buffer = NULL ;
1202
+ Uint8 * work_buffer = NULL ;
1203
1203
1204
1204
// Ensure we have enough scratch space for any conversions
1205
1205
if ((src_format != dst_format ) || (src_channels != dst_channels ) || (gain != 1.0f )) {
@@ -1269,7 +1269,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
1269
1269
work_buffer_capacity += resample_bytes ;
1270
1270
}
1271
1271
1272
- Uint8 * work_buffer = EnsureAudioStreamWorkBufferSize (stream , work_buffer_capacity );
1272
+ Uint8 * work_buffer = EnsureAudioStreamWorkBufferSize (stream , work_buffer_capacity );
1273
1273
1274
1274
if (!work_buffer ) {
1275
1275
return false;
@@ -1281,7 +1281,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
1281
1281
const float postresample_gain = (input_frames > output_frames ) ? gain : 1.0f ;
1282
1282
1283
1283
// (dst channel map is NULL because we'll do the final swizzle on ConvertAudio after resample.)
1284
- const Uint8 * input_buffer = SDL_ReadFromAudioQueue (stream -> queue ,
1284
+ const Uint8 * input_buffer = SDL_ReadFromAudioQueue (stream -> queue ,
1285
1285
NULL , resample_format , resample_channels , NULL ,
1286
1286
padding_frames , input_frames , padding_frames , work_buffer , preresample_gain );
1287
1287
@@ -1292,11 +1292,11 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
1292
1292
input_buffer += padding_frames * resample_frame_size ;
1293
1293
1294
1294
// Decide where the resampled output goes
1295
- void * resample_buffer = (resample_buffer_offset != -1 ) ? (work_buffer + resample_buffer_offset ) : buf ;
1295
+ void * resample_buffer = (resample_buffer_offset != -1 ) ? (work_buffer + resample_buffer_offset ) : buf ;
1296
1296
1297
1297
SDL_ResampleAudio (resample_channels ,
1298
- (const float * ) input_buffer , input_frames ,
1299
- (float * ) resample_buffer , output_frames ,
1298
+ (const float * )input_buffer , input_frames ,
1299
+ (float * ) resample_buffer , output_frames ,
1300
1300
resample_rate , & stream -> resample_offset );
1301
1301
1302
1302
// Convert to the final format, if necessary (src channel map is NULL because SDL_ReadFromAudioQueue already handled this).
0 commit comments