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().
This commit is contained in:
Max Kellermann 2008-09-24 07:20:37 +02:00
parent 3be5db0430
commit 63fb1efb5c
3 changed files with 11 additions and 1 deletions

View File

@ -398,7 +398,7 @@ static int jack_playAudio(struct audio_output *audioOutput,
if ( jd->shutdown ) {
ERROR("Refusing to play, because there is no client thread.\n");
freeJackClient(jd);
audioOutput->open = 0;
audio_output_closed(audioOutput);
return 0;
}

View File

@ -22,3 +22,11 @@ const char *audio_output_get_name(const struct audio_output *ao)
{
return ao->name;
}
void audio_output_closed(struct audio_output *ao)
{
assert(ao->open);
ao->open = 0;
}

View File

@ -101,4 +101,6 @@ extern struct notify audio_output_client_notify;
const char *audio_output_get_name(const struct audio_output *ao);
void audio_output_closed(struct audio_output *ao);
#endif