mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-27 21:37:37 -04:00
modules: free the stream and impl on errors
This commit is contained in:
parent
aa36fd5a17
commit
e9aff3040a
2 changed files with 12 additions and 5 deletions
|
|
@ -926,8 +926,7 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
|
||||||
spa_dll_set_bw(&impl->dll, SPA_DLL_BW_MIN, 128, impl->rate);
|
spa_dll_set_bw(&impl->dll, SPA_DLL_BW_MIN, 128, impl->rate);
|
||||||
impl->corr = 1.0;
|
impl->corr = 1.0;
|
||||||
|
|
||||||
impl->stream = pw_stream_new(core, "rtp-session", props);
|
impl->stream = pw_stream_new(core, "rtp-session", spa_steal_ptr(props));
|
||||||
props = NULL;
|
|
||||||
if (impl->stream == NULL) {
|
if (impl->stream == NULL) {
|
||||||
res = -errno;
|
res = -errno;
|
||||||
pw_log_error("can't create stream: %m");
|
pw_log_error("can't create stream: %m");
|
||||||
|
|
@ -1014,6 +1013,11 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
|
||||||
return (struct rtp_stream*)impl;
|
return (struct rtp_stream*)impl;
|
||||||
out:
|
out:
|
||||||
pw_properties_free(props);
|
pw_properties_free(props);
|
||||||
|
if (impl) {
|
||||||
|
if (impl->stream)
|
||||||
|
pw_stream_destroy(impl->stream);
|
||||||
|
free(impl);
|
||||||
|
}
|
||||||
errno = -res;
|
errno = -res;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,6 @@ struct vban_stream *vban_stream_new(struct pw_core *core,
|
||||||
if (impl == NULL) {
|
if (impl == NULL) {
|
||||||
res = -errno;
|
res = -errno;
|
||||||
goto out;
|
goto out;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
impl->first = true;
|
impl->first = true;
|
||||||
spa_hook_list_init(&impl->listener_list);
|
spa_hook_list_init(&impl->listener_list);
|
||||||
|
|
@ -388,8 +387,7 @@ struct vban_stream *vban_stream_new(struct pw_core *core,
|
||||||
spa_dll_set_bw(&impl->dll, SPA_DLL_BW_MAX, 128, impl->rate);
|
spa_dll_set_bw(&impl->dll, SPA_DLL_BW_MAX, 128, impl->rate);
|
||||||
impl->corr = 1.0;
|
impl->corr = 1.0;
|
||||||
|
|
||||||
impl->stream = pw_stream_new(core, "vban-session", props);
|
impl->stream = pw_stream_new(core, "vban-session", spa_steal_ptr(props));
|
||||||
props = NULL;
|
|
||||||
if (impl->stream == NULL) {
|
if (impl->stream == NULL) {
|
||||||
res = -errno;
|
res = -errno;
|
||||||
pw_log_error("can't create stream: %m");
|
pw_log_error("can't create stream: %m");
|
||||||
|
|
@ -443,6 +441,11 @@ struct vban_stream *vban_stream_new(struct pw_core *core,
|
||||||
return (struct vban_stream*)impl;
|
return (struct vban_stream*)impl;
|
||||||
out:
|
out:
|
||||||
pw_properties_free(props);
|
pw_properties_free(props);
|
||||||
|
if (impl) {
|
||||||
|
if (impl->stream)
|
||||||
|
pw_stream_destroy(impl->stream);
|
||||||
|
free(impl);
|
||||||
|
}
|
||||||
errno = -res;
|
errno = -res;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue