output_api: moved the command check out of method pause()
Move the "while" loop which checks for commands to the caller ao_pause(). This simplifies the pause() method, and lets us remove audio_output_is_pending().
This commit is contained in:
+11
-1
@@ -77,7 +77,17 @@ static void ao_pause(struct audio_output *ao)
|
||||
if (ao->plugin->pause != NULL) {
|
||||
/* pause is supported */
|
||||
ao_command_finished(ao);
|
||||
ao->plugin->pause(ao->data);
|
||||
|
||||
do {
|
||||
bool ret;
|
||||
|
||||
ret = ao->plugin->pause(ao->data);
|
||||
if (!ret) {
|
||||
ao->plugin->close(ao->data);
|
||||
pcm_convert_deinit(&ao->convState);
|
||||
ao->open = false;
|
||||
}
|
||||
} while (ao->command == AO_COMMAND_NONE);
|
||||
} else {
|
||||
/* pause is not supported - simply close the device */
|
||||
ao->plugin->close(ao->data);
|
||||
|
||||
Reference in New Issue
Block a user