stream: pass properties to context_new

Whe  using pw_*_new_simple(), pass the properties to the automatically
created context as well so that we can configure it.

This makes it possible to, for example, load the client-rf.conf using the
simple API as well.
This commit is contained in:
Wim Taymans 2023-11-24 10:12:49 +01:00
parent f14572648a
commit a336aabe43
3 changed files with 3 additions and 2 deletions

View file

@ -143,6 +143,7 @@ int main(int argc, char *argv[])
* the data.
*/
props = pw_properties_new(PW_KEY_MEDIA_TYPE, "Audio",
PW_KEY_CONFIG_NAME, "client-rt.conf",
PW_KEY_MEDIA_CATEGORY, "Capture",
PW_KEY_MEDIA_ROLE, "Music",
NULL);

View file

@ -1334,7 +1334,7 @@ pw_filter_new_simple(struct pw_loop *loop,
if (props == NULL)
return NULL;
context = pw_context_new(loop, NULL, 0);
context = pw_context_new(loop, pw_properties_copy(props), 0);
if (context == NULL) {
res = -errno;
goto error_cleanup;

View file

@ -1595,7 +1595,7 @@ pw_stream_new_simple(struct pw_loop *loop,
if (props == NULL)
return NULL;
context = pw_context_new(loop, NULL, 0);
context = pw_context_new(loop, pw_properties_copy(props), 0);
if (context == NULL) {
res = -errno;
goto error_cleanup;