mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pinossink: stop and disconnect the old stream when renegotiating
When we get a new format, stop, disconnect and unref the old stream. In the future we should try to send a format change on the existing stream.
This commit is contained in:
parent
563f2a2726
commit
50228dddf8
1 changed files with 5 additions and 0 deletions
|
|
@ -366,6 +366,11 @@ gst_pinos_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
}
|
||||
|
||||
pinos_main_loop_lock (pinossink->loop);
|
||||
if (pinossink->stream) {
|
||||
pinos_stream_stop (pinossink->stream);
|
||||
pinos_stream_disconnect (pinossink->stream);
|
||||
g_clear_object (&pinossink->stream);
|
||||
}
|
||||
pinossink->stream = pinos_stream_new (pinossink->ctx, pinossink->client_name, props);
|
||||
g_signal_connect (pinossink->stream, "notify::state", (GCallback) on_stream_notify, pinossink);
|
||||
g_signal_connect (pinossink->stream, "new-buffer", (GCallback) on_new_buffer, pinossink);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue