Fix some issues with pulseaudio not stopping properly.

This commit is contained in:
Paul Dino Jones 2024-06-11 14:29:09 +00:00
parent 4ad6a1339c
commit ccd7fa8bd0
2 changed files with 9 additions and 1 deletions

View File

@ -101,7 +101,8 @@ int sounddev_free(SimDevice* this)
{
SoundDevice* sounddevice = (void *) this->derived;
usb_generic_shaker_free(sounddevice);
//figure out why this is causing problems
//usb_generic_shaker_free(sounddevice);
free(sounddevice);

View File

@ -212,6 +212,7 @@ int main(int argc, char** argv)
setupsound();
SimDevice* devices = malloc(numdevices * sizeof(SimDevice));
int initdevices = devinit(devices, configureddevices, ds, ms);
bool pulseaudio = false;
if (p->program_action == A_PLAY)
{
@ -223,6 +224,7 @@ int main(int argc, char** argv)
//}
#ifdef USE_PULSEAUDIO
pa_threaded_mainloop_unlock(mainloop);
pulseaudio = true;
#endif
error = looper(devices, initdevices, p);
@ -241,6 +243,7 @@ int main(int argc, char** argv)
#ifdef USE_PULSEAUDIO
pa_threaded_mainloop_unlock(mainloop);
pulseaudio = true;
#endif
error = tester(devices, initdevices);
@ -262,6 +265,10 @@ int main(int argc, char** argv)
devices[x].free(&devices[x]);
}
}
if(pulseaudio == true)
{
freesound();
}
i = 0;
// improve the api around the config helper