Commit 63fb1efb authored by Max Kellermann's avatar Max Kellermann

output: added audio_output_closed()

The JACK output plugin needs to reset its "opened" flag when the JACK server fails. To prevent it from accessing the audio_output struct directly introduce the API function audio_output_closed().
parent 3be5db04
...@@ -398,7 +398,7 @@ static int jack_playAudio(struct audio_output *audioOutput, ...@@ -398,7 +398,7 @@ static int jack_playAudio(struct audio_output *audioOutput,
if ( jd->shutdown ) { if ( jd->shutdown ) {
ERROR("Refusing to play, because there is no client thread.\n"); ERROR("Refusing to play, because there is no client thread.\n");
freeJackClient(jd); freeJackClient(jd);
audioOutput->open = 0; audio_output_closed(audioOutput);
return 0; return 0;
} }
......
...@@ -22,3 +22,11 @@ const char *audio_output_get_name(const struct audio_output *ao) ...@@ -22,3 +22,11 @@ const char *audio_output_get_name(const struct audio_output *ao)
{ {
return ao->name; return ao->name;
} }
void audio_output_closed(struct audio_output *ao)
{
assert(ao->open);
ao->open = 0;
}
...@@ -101,4 +101,6 @@ extern struct notify audio_output_client_notify; ...@@ -101,4 +101,6 @@ extern struct notify audio_output_client_notify;
const char *audio_output_get_name(const struct audio_output *ao); const char *audio_output_get_name(const struct audio_output *ao);
void audio_output_closed(struct audio_output *ao);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment