int audio_is_pull(void)
{
int type = sdp->devicetype;
- if (sdp->reset)
+ if (sdp->reset) {
return 0;
+ }
if (type == SOUND_DEVICE_WASAPI || type == SOUND_DEVICE_WASAPI_EXCLUSIVE || type == SOUND_DEVICE_PA) {
struct sound_dp *s = sdp->data;
if (s && s->pullmode) {
int cnt = 0;
int type = sdp->devicetype;
- if (sdp->paused || sdp->deactive || sdp->reset)
+ if (sdp->paused || sdp->deactive || sdp->reset) {
return 0;
+ }
if (type == SOUND_DEVICE_WASAPI || type == SOUND_DEVICE_WASAPI_EXCLUSIVE || type == SOUND_DEVICE_PA) {
struct sound_dp *s = sdp->data;
if (s->pullbufferlen > 0) {
cnt++;
int size = (int)((uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer);
- if (size > sdp->sndbufsize * 2 / 3)
+ if (size > sdp->sndbufsize * 2 / 3) {
cnt++;
+ }
}
}
return cnt;
bool audio_is_pull_event(void)
{
int type = sdp->devicetype;
- if (sdp->paused || sdp->deactive || sdp->reset)
+ if (sdp->paused || sdp->deactive || sdp->reset) {
return false;
+ }
if (type == SOUND_DEVICE_WASAPI || type == SOUND_DEVICE_WASAPI_EXCLUSIVE || type == SOUND_DEVICE_PA) {
struct sound_dp *s = sdp->data;
if (s->pullmode) {
int type = sdp->devicetype;
if (sdp->paused || sdp->deactive || sdp->reset)
return false;
- if (type != SOUND_DEVICE_WASAPI && type != SOUND_DEVICE_WASAPI_EXCLUSIVE && type != SOUND_DEVICE_PA)
+ if (type != SOUND_DEVICE_WASAPI && type != SOUND_DEVICE_WASAPI_EXCLUSIVE && type != SOUND_DEVICE_PA) {
return false;
- if (audio_pull_buffer() && audio_is_pull_event()) {
+ }
+ int apb = audio_pull_buffer();
+ if (apb >= 2 || (apb = 1 && audio_is_pull_event())) {
return send_sound_do(sdp);
}
return false;