| 530 | } |
| 531 | |
| 532 | inline void |
| 533 | PulseOutput::OnStreamStateChanged(pa_stream *_stream, |
| 534 | pa_stream_state_t new_state) |
| 535 | { |
| 536 | assert(_stream == stream || stream == nullptr); |
| 537 | assert(mainloop != nullptr); |
| 538 | assert(context != nullptr); |
| 539 | |
| 540 | switch (new_state) { |
| 541 | case PA_STREAM_READY: |
| 542 | if (mixer != nullptr) |
| 543 | pulse_mixer_on_change(*mixer, context, _stream); |
| 544 | |
| 545 | Signal(); |
| 546 | break; |
| 547 | |
| 548 | case PA_STREAM_FAILED: |
| 549 | case PA_STREAM_TERMINATED: |
| 550 | if (mixer != nullptr) |
| 551 | pulse_mixer_on_disconnect(*mixer); |
| 552 | |
| 553 | Signal(); |
| 554 | break; |
| 555 | |
| 556 | case PA_STREAM_UNCONNECTED: |
| 557 | case PA_STREAM_CREATING: |
| 558 | break; |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | static void |
| 563 | pulse_output_stream_state_cb(pa_stream *stream, void *userdata) |
no test coverage detected