Pipewireパッケージ(ちょっと変更)
Revisão | a852b979b67570e695135a5d4cbe78fac6c1962b (tree) |
---|---|
Hora | 2023-11-10 05:59:40 |
Autor | George Kiagiadakis <george.kiagiadakis@coll...> |
Commiter | Wim Taymans |
gst: avoid reporting error twice
First, make the error permanent by calling pw_stream_set_error()
and when this emits an error state again, report that to GStreamer.
Do the same in pipewiresink, which didn't even have the
pw_stream_set_error() call before, so the stream wasn't really going
into an error state at all.
@@ -532,8 +532,13 @@ on_state_changed (void *data, enum pw_stream_state old, enum pw_stream_state sta | ||
532 | 532 | pw_stream_trigger_process (pwsink->stream); |
533 | 533 | break; |
534 | 534 | case PW_STREAM_STATE_ERROR: |
535 | - GST_ELEMENT_ERROR (pwsink, RESOURCE, FAILED, | |
536 | - ("stream error: %s", error), (NULL)); | |
535 | + /* make the error permanent, if it is not already; | |
536 | + pw_stream_set_error() will recursively call us again */ | |
537 | + if (pw_stream_get_state (pwsink->stream, NULL) != PW_STREAM_STATE_ERROR) | |
538 | + pw_stream_set_error (pwsink->stream, -EPIPE, "%s", error); | |
539 | + else | |
540 | + GST_ELEMENT_ERROR (pwsink, RESOURCE, FAILED, | |
541 | + ("stream error: %s", error), (NULL)); | |
537 | 542 | break; |
538 | 543 | } |
539 | 544 | pw_thread_loop_signal (pwsink->core->loop, FALSE); |
@@ -681,9 +681,13 @@ on_state_changed (void *data, | ||
681 | 681 | case PW_STREAM_STATE_STREAMING: |
682 | 682 | break; |
683 | 683 | case PW_STREAM_STATE_ERROR: |
684 | - pw_stream_set_error (pwsrc->stream, -EPIPE, "%s", error); | |
685 | - GST_ELEMENT_ERROR (pwsrc, RESOURCE, FAILED, | |
686 | - ("stream error: %s", error), (NULL)); | |
684 | + /* make the error permanent, if it is not already; | |
685 | + pw_stream_set_error() will recursively call us again */ | |
686 | + if (pw_stream_get_state (pwsrc->stream, NULL) != PW_STREAM_STATE_ERROR) | |
687 | + pw_stream_set_error (pwsrc->stream, -EPIPE, "%s", error); | |
688 | + else | |
689 | + GST_ELEMENT_ERROR (pwsrc, RESOURCE, FAILED, | |
690 | + ("stream error: %s", error), (NULL)); | |
687 | 691 | break; |
688 | 692 | } |
689 | 693 | pw_thread_loop_signal (pwsrc->core->loop, FALSE); |