summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-05-27 22:05:06 +0000
committerLennart Poettering <lennart@poettering.net>2008-05-27 22:05:06 +0000
commit21dedcb9d90734de96f17043d03183e2ab599583 (patch)
tree117f6948571fb088ed86bb348ed148339ca06a28 /src/pulse
parentd332439065ea1b4e81c49b3e67715cba9f642806 (diff)
readd name field to upload datagram
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2487 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/scache.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pulse/scache.c b/src/pulse/scache.c
index e43a0b9f..426c57c3 100644
--- a/src/pulse/scache.c
+++ b/src/pulse/scache.c
@@ -31,6 +31,7 @@
#include <pulsecore/pstream-util.h>
#include <pulsecore/macro.h>
+#include <pulse/utf8.h>
#include "internal.h"
@@ -39,6 +40,7 @@
int pa_stream_connect_upload(pa_stream *s, size_t length) {
pa_tagstruct *t;
uint32_t tag;
+ const char *name;
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
@@ -46,6 +48,11 @@ int pa_stream_connect_upload(pa_stream *s, size_t length) {
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, length > 0, PA_ERR_INVALID);
+ if (!(name = pa_proplist_gets(s->proplist, PA_PROP_EVENT_ID)))
+ name = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_NAME);
+
+ PA_CHECK_VALIDITY(s->context, name && *name && pa_utf8_valid(name), PA_ERR_INVALID);
+
pa_stream_ref(s);
s->direction = PA_STREAM_UPLOAD;
@@ -53,9 +60,7 @@ int pa_stream_connect_upload(pa_stream *s, size_t length) {
t = pa_tagstruct_command(s->context, PA_COMMAND_CREATE_UPLOAD_STREAM, &tag);
- if (s->context->version < 13)
- pa_tagstruct_puts(t, pa_proplist_gets(s->proplist, PA_PROP_MEDIA_NAME));
-
+ pa_tagstruct_puts(t, name);
pa_tagstruct_put_sample_spec(t, &s->sample_spec);
pa_tagstruct_put_channel_map(t, &s->channel_map);
pa_tagstruct_putu32(t, length);