context: improve properties

This commit is contained in:
Wim Taymans 2018-10-03 20:14:34 +02:00
parent 520a9831e7
commit 6a4da8a6b3
3 changed files with 11 additions and 11 deletions

View file

@ -325,7 +325,6 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
if (r == NULL) if (r == NULL)
return NULL; return NULL;
c = pw_remote_get_user_data(r); c = pw_remote_get_user_data(r);
c->loop = loop; c->loop = loop;
c->core = core; c->core = core;

View file

@ -164,8 +164,7 @@ const char *pa_proplist_iterate(pa_proplist *p, void **state)
char *pa_proplist_to_string(pa_proplist *p) char *pa_proplist_to_string(pa_proplist *p)
{ {
spa_assert(p); spa_assert(p);
pw_log_warn("Not Implemented"); return pa_proplist_to_string_sep(p, ",");
return NULL;
} }
char *pa_proplist_to_string_sep(pa_proplist *p, const char *sep) char *pa_proplist_to_string_sep(pa_proplist *p, const char *sep)

View file

@ -504,6 +504,7 @@ pa_stream* stream_new(pa_context *c, const char *name,
pa_stream *s; pa_stream *s;
char str[1024]; char str[1024];
int i; int i;
struct pw_properties *props;
spa_assert(c); spa_assert(c);
spa_assert(c->refcount >= 1); spa_assert(c->refcount >= 1);
@ -517,11 +518,16 @@ pa_stream* stream_new(pa_context *c, const char *name,
if (s == NULL) if (s == NULL)
return NULL; return NULL;
s->proplist = p ? pa_proplist_copy(p) : pa_proplist_new();
if (name)
pa_proplist_sets(s->proplist, PA_PROP_MEDIA_NAME, name);
else
name = pa_proplist_gets(p, PA_PROP_MEDIA_NAME);
s->stream = pw_stream_new(c->remote, name, props = pw_properties_new("client.api", "pulseaudio",
pw_properties_new( NULL);
"client.api", "pulseaudio",
NULL)); s->stream = pw_stream_new(c->remote, name, props);
s->refcount = 1; s->refcount = 1;
s->context = c; s->context = c;
spa_list_init(&s->pending); spa_list_init(&s->pending);
@ -554,10 +560,6 @@ pa_stream* stream_new(pa_context *c, const char *name,
s->direct_on_input = PA_INVALID_INDEX; s->direct_on_input = PA_INVALID_INDEX;
s->proplist = p ? pa_proplist_copy(p) : pa_proplist_new();
if (name)
pa_proplist_sets(s->proplist, PA_PROP_MEDIA_NAME, name);
s->stream_index = PA_INVALID_INDEX; s->stream_index = PA_INVALID_INDEX;
s->buffer_attr.maxlength = (uint32_t) -1; s->buffer_attr.maxlength = (uint32_t) -1;