wasapi: Fix double call to Start when resetting the element

When either the source or sink goes from PLAYING -> NULL -> PLAYING,
we call _reset() which sets client_needs_restart, and then we call
prepare() which calls IAudioClient_Start(), so we don't need to call
it again in src_read() or sink_write(). Unlike when we're just going
PLAYING -> PAUSED -> PLAYING.
This commit is contained in:
Nirbheek Chauhan 2019-01-04 18:36:43 +05:30
parent 2f05ee9ba9
commit 8249763f6c
2 changed files with 2 additions and 0 deletions

View file

@ -557,6 +557,7 @@ gst_wasapi_sink_prepare (GstAudioSink * asink, GstAudioRingBufferSpec * spec)
hr = IAudioClient_Start (self->client);
HR_FAILED_GOTO (hr, IAudioClient::Start, beach);
self->client_needs_restart = FALSE;
gst_audio_ring_buffer_set_channel_positions (GST_AUDIO_BASE_SINK
(self)->ringbuffer, self->positions);

View file

@ -508,6 +508,7 @@ gst_wasapi_src_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec)
hr = IAudioClient_Start (self->client);
HR_FAILED_GOTO (hr, IAudioClock::Start, beach);
self->client_needs_restart = FALSE;
gst_audio_ring_buffer_set_channel_positions (GST_AUDIO_BASE_SRC
(self)->ringbuffer, self->positions);