wasapi: fix reinit of audioclient in prepare()
authorJakub Janků <jjanku@redhat.com>
Thu, 18 Mar 2021 09:55:58 +0000 (10:55 +0100)
committerJakub Janků <janku.jakub.jj@gmail.com>
Mon, 12 Jul 2021 11:47:07 +0000 (13:47 +0200)
commit211f968981ba6f2d33dc25b167385f971c616b21
treef3a07f1b20a17080528b5d7b29647d10ccc829d5
parent766a1263808f337481a39a2dd38975a9a5b4df0c
wasapi: fix reinit of audioclient in prepare()

When the sink goes from PLAYING to READY and then back to PLAYING,
the initialization of the audioclient in prepare() fails with the
error AUDCLNT_E_ALREADY_INITIALIZED. As a result, the playback
stops.

To fix this, we need to drop the AudioClient in unprepare() and
grab a new one in prepare() to be able to initialize it again
with the new buffer spec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2096>
sys/wasapi/gstwasapisink.c