mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
stream: set proxy to NULL in disconnect
The proxy is NULL while disconnected, handle this case.
This commit is contained in:
parent
20bcbbde78
commit
dfc464413b
1 changed files with 4 additions and 1 deletions
|
|
@ -833,7 +833,7 @@ static void on_remote_state_changed(void *_data, enum pw_remote_state old,
|
||||||
static void on_remote_exported(void *_data, uint32_t id)
|
static void on_remote_exported(void *_data, uint32_t id)
|
||||||
{
|
{
|
||||||
struct pw_stream *stream = _data;
|
struct pw_stream *stream = _data;
|
||||||
if (stream->proxy->id == id)
|
if (stream->proxy && stream->proxy->id == id)
|
||||||
stream_set_state(stream, PW_STREAM_STATE_CONFIGURE, NULL);
|
stream_set_state(stream, PW_STREAM_STATE_CONFIGURE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1112,6 +1112,8 @@ pw_stream_connect(struct pw_stream *stream,
|
||||||
|
|
||||||
uint32_t pw_stream_get_node_id(struct pw_stream *stream)
|
uint32_t pw_stream_get_node_id(struct pw_stream *stream)
|
||||||
{
|
{
|
||||||
|
if (stream->proxy == NULL)
|
||||||
|
return SPA_ID_INVALID;
|
||||||
return stream->proxy->remote_id;
|
return stream->proxy->remote_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1126,6 +1128,7 @@ int pw_stream_disconnect(struct pw_stream *stream)
|
||||||
pw_node_destroy(impl->node);
|
pw_node_destroy(impl->node);
|
||||||
impl->node = NULL;
|
impl->node = NULL;
|
||||||
}
|
}
|
||||||
|
stream->proxy = NULL;
|
||||||
stream_set_state(stream, PW_STREAM_STATE_UNCONNECTED, NULL);
|
stream_set_state(stream, PW_STREAM_STATE_UNCONNECTED, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue