diff options
-rw-r--r-- | audio/out/ao_wasapi0.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/audio/out/ao_wasapi0.c b/audio/out/ao_wasapi0.c index 6a3bfc943c..11303ddde1 100644 --- a/audio/out/ao_wasapi0.c +++ b/audio/out/ao_wasapi0.c @@ -430,15 +430,10 @@ exit_label: static void thread_pause(wasapi0_state *state) { + state->is_playing = 0; IAudioClient_Stop(state->pAudioClient); } -static void thread_reset(wasapi0_state *state) -{ - IAudioClient_Stop(state->pAudioClient); - IAudioClient_Reset(state->pAudioClient); -} - /* force_feed - feed in even if available data is smaller than required buffer, to clear the buffer */ static void thread_feed(wasapi0_state *state,int force_feed) { @@ -477,10 +472,20 @@ exit_label: static void thread_play(wasapi0_state *state) { thread_feed(state, 0); + state->is_playing = 1; IAudioClient_Start(state->pAudioClient); return; } +static void thread_reset(wasapi0_state *state) +{ + IAudioClient_Stop(state->pAudioClient); + IAudioClient_Reset(state->pAudioClient); + if (state->is_playing) { + thread_play(state); + } +} + static void thread_getVol(wasapi0_state *state) { IAudioEndpointVolume_GetMasterVolumeLevelScalar(state->pEndpointVolume, |