From 9ff1c93ab1203a104a1593d9e8dfab10ebe3ad7a Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Sat, 17 May 2025 09:16:24 -0400 Subject: [PATCH] media-sink: Set up ASHA source after setting transport state We need to make sure the state is available when the source starts, so that it does not assert in flush_data() --- spa/plugins/bluez5/media-sink.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spa/plugins/bluez5/media-sink.c b/spa/plugins/bluez5/media-sink.c index 3020edfd9..f7748630b 100644 --- a/spa/plugins/bluez5/media-sink.c +++ b/spa/plugins/bluez5/media-sink.c @@ -1541,6 +1541,14 @@ static int transport_start(struct impl *this) spa_loop_add_source(this->data_loop, &this->flush_source); } + this->resync = RESYNC_CYCLES; + this->flush_pending = false; + this->iso_pending = false; + + this->transport_started = true; + + if (this->transport->iso_io) + spa_loop_invoke(this->data_loop, do_start_iso_io, 0, NULL, 0, true, this); if (is_asha) { struct spa_bt_asha *asha = this->asha; @@ -1564,14 +1572,6 @@ static int transport_start(struct impl *this) spa_list_append(&asha_sinks, &this->asha_link); } - this->resync = RESYNC_CYCLES; - this->flush_pending = false; - this->iso_pending = false; - - this->transport_started = true; - - if (this->transport->iso_io) - spa_loop_invoke(this->data_loop, do_start_iso_io, 0, NULL, 0, true, this); return 0; }