oss: don't fail resume if trigger() fails
authorTanu Kaskinen <tanuk@iki.fi>
Tue, 13 Mar 2018 17:40:37 +0000 (19:40 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 16 Mar 2018 18:04:34 +0000 (20:04 +0200)
commit73b8a57078b94033edf84de2fc0cfbe344c10dcd
tree0f3c23a870b3f29e33b767f1b9d8c4baa01526af
parent0fad369ceb18a8e275e8f74f10f784e0d7476dfb
oss: don't fail resume if trigger() fails

The previous code made the SET_STATE message fail if trigger() failed.
However, trigger() was called after pa_sink/source_process_msg(), which
meant that the main thread that sent the SET_STATE thought that resuming
failed, but nothing was undone in the IO thread, so in the IO thread
things seemed as if the sink/source was successfully resumed. (I don't
use OSS myself, so I don't know what kind of practical problems this
could cause).

Unless some complex undo logic is implemented, I believe it's best to
ignore all failures in trigger(). Most error cases were already ignored,
and the only one that wasn't ignored doesn't seem too serious.

I also moved trigger() to happen before pa_sink/source_process_msg(),
which made it necessary to add new state parameters to trigger(). The
reason for this move is that I want to move the SET_STATE handler code
into a separate callback, and if things are done both before and after
pa_sink/source_process_msg(), that makes things more complicated.

The previous code checked the return value of
pa_sink/source_process_msg() before calling trigger(), but that was
unnecessary, since pa_sink/source_process_msg() never fails when
processing the SET_STATE messages.
src/modules/oss/module-oss.c