|
@@ -52,7 +52,7 @@ FeedAudioDevice(_THIS, const void *buf, const int buflen)
|
|
static void
|
|
static void
|
|
HandleAudioProcess(_THIS)
|
|
HandleAudioProcess(_THIS)
|
|
{
|
|
{
|
|
- SDL_AudioCallback callback = this->spec.callback;
|
|
|
|
|
|
+ SDL_AudioCallback callback = this->callbackspec.callback;
|
|
const int stream_len = this->callbackspec.size;
|
|
const int stream_len = this->callbackspec.size;
|
|
|
|
|
|
/* Only do something if audio is enabled */
|
|
/* Only do something if audio is enabled */
|
|
@@ -65,11 +65,11 @@ HandleAudioProcess(_THIS)
|
|
|
|
|
|
if (this->stream == NULL) { /* no conversion necessary. */
|
|
if (this->stream == NULL) { /* no conversion necessary. */
|
|
SDL_assert(this->spec.size == stream_len);
|
|
SDL_assert(this->spec.size == stream_len);
|
|
- callback(this->spec.userdata, this->work_buffer, stream_len);
|
|
|
|
|
|
+ callback(this->callbackspec.userdata, this->work_buffer, stream_len);
|
|
} else { /* streaming/converting */
|
|
} else { /* streaming/converting */
|
|
int got;
|
|
int got;
|
|
while (SDL_AudioStreamAvailable(this->stream) < ((int) this->spec.size)) {
|
|
while (SDL_AudioStreamAvailable(this->stream) < ((int) this->spec.size)) {
|
|
- callback(this->spec.userdata, this->work_buffer, stream_len);
|
|
|
|
|
|
+ callback(this->callbackspec.userdata, this->work_buffer, stream_len);
|
|
if (SDL_AudioStreamPut(this->stream, this->work_buffer, stream_len) == -1) {
|
|
if (SDL_AudioStreamPut(this->stream, this->work_buffer, stream_len) == -1) {
|
|
SDL_AudioStreamClear(this->stream);
|
|
SDL_AudioStreamClear(this->stream);
|
|
SDL_AtomicSet(&this->enabled, 0);
|
|
SDL_AtomicSet(&this->enabled, 0);
|
|
@@ -90,7 +90,7 @@ HandleAudioProcess(_THIS)
|
|
static void
|
|
static void
|
|
HandleCaptureProcess(_THIS)
|
|
HandleCaptureProcess(_THIS)
|
|
{
|
|
{
|
|
- SDL_AudioCallback callback = this->spec.callback;
|
|
|
|
|
|
+ SDL_AudioCallback callback = this->callbackspec.callback;
|
|
const int stream_len = this->callbackspec.size;
|
|
const int stream_len = this->callbackspec.size;
|
|
|
|
|
|
/* Only do something if audio is enabled */
|
|
/* Only do something if audio is enabled */
|
|
@@ -123,7 +123,7 @@ HandleCaptureProcess(_THIS)
|
|
|
|
|
|
if (this->stream == NULL) { /* no conversion necessary. */
|
|
if (this->stream == NULL) { /* no conversion necessary. */
|
|
SDL_assert(this->spec.size == stream_len);
|
|
SDL_assert(this->spec.size == stream_len);
|
|
- callback(this->spec.userdata, this->work_buffer, stream_len);
|
|
|
|
|
|
+ callback(this->callbackspec.userdata, this->work_buffer, stream_len);
|
|
} else { /* streaming/converting */
|
|
} else { /* streaming/converting */
|
|
if (SDL_AudioStreamPut(this->stream, this->work_buffer, this->spec.size) == -1) {
|
|
if (SDL_AudioStreamPut(this->stream, this->work_buffer, this->spec.size) == -1) {
|
|
SDL_AtomicSet(&this->enabled, 0);
|
|
SDL_AtomicSet(&this->enabled, 0);
|
|
@@ -135,7 +135,7 @@ HandleCaptureProcess(_THIS)
|
|
if (got != stream_len) {
|
|
if (got != stream_len) {
|
|
SDL_memset(this->work_buffer, this->callbackspec.silence, stream_len);
|
|
SDL_memset(this->work_buffer, this->callbackspec.silence, stream_len);
|
|
}
|
|
}
|
|
- callback(this->spec.userdata, this->work_buffer, stream_len); /* Send it to the app. */
|
|
|
|
|
|
+ callback(this->callbackspec.userdata, this->work_buffer, stream_len); /* Send it to the app. */
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|