| Summary: | [PATCH] jack audio driver fails in presence of midi ports | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Martin Širokov <shirokovMartin+SDL> |
| Component: | audio | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | fix jack audio driver | ||
Patch added, thanks! https://hg.libsdl.org/SDL/rev/94f3f018d3eb |
Created attachment 3254 [details] fix jack audio driver Launching an SDL application with SDL_AUDIODRIVER=jack, and then calling SDL_OpenAudioDevice() with whatever parameters fails with an error like this one: SDL_OpenAudioDevice: Couldn't connect JACK ports: SDL:sdl_jack_output_0 => system:midi_playback_1 This happens because JACK_OpenDevice in src/audio/jack/SDL_jackaudio.c blindly tries to connect to all input ports without checking whether they are for audio or midi. The fix is to check port types and ignore all non audio ports. Also I removed devports field from struct SDL_PrivateAudioData, because it's never really used and removing unused ports from it would be PITA.