output: always call cancel() before stop()

Stopping an audio output device without cancelling its buffer doesn't
make sense.  Combine the two operations, which saves several cancel
calls.
This commit is contained in:
Max Kellermann
2008-10-29 22:17:42 +01:00
parent 07bb46de88
commit 678314534a
3 changed files with 7 additions and 14 deletions

View File

@@ -152,7 +152,6 @@ static void processDecodeInput(struct player *player)
case PLAYER_COMMAND_PAUSE:
player->paused = !player->paused;
if (player->paused) {
dropBufferedAudio();
audio_output_pause_all();
pc.state = PLAYER_STATE_PAUSE;
} else {
@@ -298,10 +297,9 @@ static void do_play(void)
break;
}
if (player.paused) {
dropBufferedAudio();
if (player.paused)
closeAudioDevice();
}
pc.totalTime = dc.totalTime;
pc.audio_format = dc.audioFormat;
play_audio_format = ob.audioFormat;