mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
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.
This commit is contained in:
parent
636a9c611d
commit
a852b979b6
2 changed files with 14 additions and 5 deletions
|
|
@ -532,6 +532,11 @@ on_state_changed (void *data, enum pw_stream_state old, enum pw_stream_state sta
|
|||
pw_stream_trigger_process (pwsink->stream);
|
||||
break;
|
||||
case PW_STREAM_STATE_ERROR:
|
||||
/* make the error permanent, if it is not already;
|
||||
pw_stream_set_error() will recursively call us again */
|
||||
if (pw_stream_get_state (pwsink->stream, NULL) != PW_STREAM_STATE_ERROR)
|
||||
pw_stream_set_error (pwsink->stream, -EPIPE, "%s", error);
|
||||
else
|
||||
GST_ELEMENT_ERROR (pwsink, RESOURCE, FAILED,
|
||||
("stream error: %s", error), (NULL));
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -681,7 +681,11 @@ on_state_changed (void *data,
|
|||
case PW_STREAM_STATE_STREAMING:
|
||||
break;
|
||||
case PW_STREAM_STATE_ERROR:
|
||||
/* make the error permanent, if it is not already;
|
||||
pw_stream_set_error() will recursively call us again */
|
||||
if (pw_stream_get_state (pwsrc->stream, NULL) != PW_STREAM_STATE_ERROR)
|
||||
pw_stream_set_error (pwsrc->stream, -EPIPE, "%s", error);
|
||||
else
|
||||
GST_ELEMENT_ERROR (pwsrc, RESOURCE, FAILED,
|
||||
("stream error: %s", error), (NULL));
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue