The sink can be resumed while the source is still in PA_SOURCE_INIT.
This is the case if a module such as module-stream-restore routes the
audio to the sink during pa_sink_put(), leading to an inconsistent
state: the sink stays RUNNING but the transport is not actually
acquired.
break;
/* Resume the device if the source was suspended as well */
- if (!u->source || u->source->state == PA_SOURCE_SUSPENDED) {
+ if (!u->source || !PA_SOURCE_IS_OPENED(u->source->thread_info.state)) {
if (bt_transport_acquire(u, TRUE) < 0)
failed = TRUE;
}
break;
/* Resume the device if the sink was suspended as well */
- if (!u->sink || u->sink->thread_info.state == PA_SINK_SUSPENDED) {
+ if (!u->sink || !PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
if (bt_transport_acquire(u, TRUE) < 0)
failed = TRUE;
}