mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-07 18:39:37 +01:00
Fixed whitespace
This commit is contained in:
parent
b521df66c3
commit
455944c870
@ -376,7 +376,7 @@ static BOOL update_audio_session(_THIS, SDL_bool open)
|
|||||||
/* An interruption end notification is not guaranteed to be sent if
|
/* An interruption end notification is not guaranteed to be sent if
|
||||||
we were previously interrupted... resuming if needed when the app
|
we were previously interrupted... resuming if needed when the app
|
||||||
becomes active seems to be the way to go. */
|
becomes active seems to be the way to go. */
|
||||||
// Note: object: below needs to be nil, as otherwise it filters by the object, and session doesn't send foreground / active notifications. johna
|
// Note: object: below needs to be nil, as otherwise it filters by the object, and session doesn't send foreground / active notifications. johna
|
||||||
[center addObserver:listener
|
[center addObserver:listener
|
||||||
selector:@selector(applicationBecameActive:)
|
selector:@selector(applicationBecameActive:)
|
||||||
name:UIApplicationDidBecomeActiveNotification
|
name:UIApplicationDidBecomeActiveNotification
|
||||||
@ -417,35 +417,35 @@ outputCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffe
|
|||||||
if (!SDL_AtomicGet(&this->enabled) || SDL_AtomicGet(&this->paused)) {
|
if (!SDL_AtomicGet(&this->enabled) || SDL_AtomicGet(&this->paused)) {
|
||||||
/* Supply silence if audio is not enabled or paused */
|
/* Supply silence if audio is not enabled or paused */
|
||||||
SDL_memset(inBuffer->mAudioData, this->spec.silence, inBuffer->mAudioDataBytesCapacity);
|
SDL_memset(inBuffer->mAudioData, this->spec.silence, inBuffer->mAudioDataBytesCapacity);
|
||||||
} else if (this->stream ) {
|
} else if (this->stream ) {
|
||||||
UInt32 remaining = inBuffer->mAudioDataBytesCapacity;
|
UInt32 remaining = inBuffer->mAudioDataBytesCapacity;
|
||||||
Uint8 *ptr = (Uint8 *) inBuffer->mAudioData;
|
Uint8 *ptr = (Uint8 *) inBuffer->mAudioData;
|
||||||
|
|
||||||
while (remaining > 0) {
|
while (remaining > 0) {
|
||||||
if ( SDL_AudioStreamAvailable(this->stream) == 0 ) {
|
if ( SDL_AudioStreamAvailable(this->stream) == 0 ) {
|
||||||
/* Generate the data */
|
/* Generate the data */
|
||||||
SDL_LockMutex(this->mixer_lock);
|
SDL_LockMutex(this->mixer_lock);
|
||||||
(*this->callbackspec.callback)(this->callbackspec.userdata,
|
(*this->callbackspec.callback)(this->callbackspec.userdata,
|
||||||
this->hidden->buffer, this->hidden->bufferSize);
|
this->hidden->buffer, this->hidden->bufferSize);
|
||||||
SDL_UnlockMutex(this->mixer_lock);
|
SDL_UnlockMutex(this->mixer_lock);
|
||||||
this->hidden->bufferOffset = 0;
|
this->hidden->bufferOffset = 0;
|
||||||
SDL_AudioStreamPut(this->stream, this->hidden->buffer, this->hidden->bufferSize);
|
SDL_AudioStreamPut(this->stream, this->hidden->buffer, this->hidden->bufferSize);
|
||||||
}
|
}
|
||||||
if ( SDL_AudioStreamAvailable(this->stream) > 0 ) {
|
if ( SDL_AudioStreamAvailable(this->stream) > 0 ) {
|
||||||
int got;
|
int got;
|
||||||
UInt32 len = SDL_AudioStreamAvailable(this->stream);
|
UInt32 len = SDL_AudioStreamAvailable(this->stream);
|
||||||
if ( len > remaining )
|
if ( len > remaining )
|
||||||
len = remaining;
|
len = remaining;
|
||||||
got = SDL_AudioStreamGet(this->stream, ptr, len);
|
got = SDL_AudioStreamGet(this->stream, ptr, len);
|
||||||
SDL_assert((got < 0) || (got == len));
|
SDL_assert((got < 0) || (got == len));
|
||||||
if (got != len) {
|
if (got != len) {
|
||||||
SDL_memset(ptr, this->spec.silence, len);
|
SDL_memset(ptr, this->spec.silence, len);
|
||||||
}
|
}
|
||||||
ptr = ptr + len;
|
ptr = ptr + len;
|
||||||
remaining -= len;
|
remaining -= len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
UInt32 remaining = inBuffer->mAudioDataBytesCapacity;
|
UInt32 remaining = inBuffer->mAudioDataBytesCapacity;
|
||||||
Uint8 *ptr = (Uint8 *) inBuffer->mAudioData;
|
Uint8 *ptr = (Uint8 *) inBuffer->mAudioData;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user