diff options
author | Mikel Astiz <mikel.astiz@bmw-carit.de> | 2012-08-31 12:51:00 +0200 |
---|---|---|
committer | Jaska Uimonen <jaska.uimonen@intel.com> | 2013-01-24 09:29:36 +0200 |
commit | 1ae95a79965b615662c0d0b6dbc452fc0a1b9498 (patch) | |
tree | 2d5ef2e47e4738d6af2323eb03a2af2eaee7cf3a | |
parent | 3124a216b11792eddef410a3974b09991e87019a (diff) | |
download | pulseaudio-panda-1ae95a79965b615662c0d0b6dbc452fc0a1b9498.tar.gz pulseaudio-panda-1ae95a79965b615662c0d0b6dbc452fc0a1b9498.tar.bz2 pulseaudio-panda-1ae95a79965b615662c0d0b6dbc452fc0a1b9498.zip |
sink, source: Support creating suspended sinks and sources
The initial state of a sink or source might not necessarily be IDLE,
because sometimes it might be suspended from the very beginning.
-rw-r--r-- | src/modules/bluetooth/module-bluetooth-device.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 8da0d7e3..0323a458 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -380,7 +380,9 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse switch ((pa_sink_state_t) PA_PTR_TO_UINT(data)) { case PA_SINK_SUSPENDED: - pa_assert(PA_SINK_IS_OPENED(u->sink->thread_info.state)); + /* Ignore if transition is PA_SINK_INIT->PA_SINK_SUSPENDED */ + if (!PA_SINK_IS_OPENED(u->sink->thread_info.state)) + break; /* Stop the device if the source is suspended as well */ if (!u->source || u->source->state == PA_SOURCE_SUSPENDED) @@ -454,7 +456,9 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off switch ((pa_source_state_t) PA_PTR_TO_UINT(data)) { case PA_SOURCE_SUSPENDED: - pa_assert(PA_SOURCE_IS_OPENED(u->source->thread_info.state)); + /* Ignore if transition is PA_SOURCE_INIT->PA_SOURCE_SUSPENDED */ + if (!PA_SOURCE_IS_OPENED(u->source->thread_info.state)) + break; /* Stop the device if the sink is suspended as well */ if (!u->sink || u->sink->state == PA_SINK_SUSPENDED) |