summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2018-05-27 05:15:14 +0100
committerTanu Kaskinen <tanuk@iki.fi>2018-06-04 13:20:19 +0300
commit055e466a6b48703aa577e49a71c9221c5226fd08 (patch)
tree2d5ec488faecb9a0f4e85ef6fd99e07eeba2ff08
parentc0ea7d2c6138f09f7abd172a9e7f2a170e49c316 (diff)
downloadpulseaudio-055e466a6b48703aa577e49a71c9221c5226fd08.tar.gz
scache: pa_context_play_sample_with_proplist: constify proplist param
If the given proplist is NULL, the function creates a new (empty) proplist. That caused a compiler warning after the constification, which is why the new proplist is now created using a separate variable.
-rw-r--r--src/pulse/scache.c8
-rw-r--r--src/pulse/scache.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/pulse/scache.c b/src/pulse/scache.c
index de7b41120..d393229b5 100644
--- a/src/pulse/scache.c
+++ b/src/pulse/scache.c
@@ -205,7 +205,7 @@ pa_operation *pa_context_play_sample(pa_context *c, const char *name, const char
return o;
}
-pa_operation *pa_context_play_sample_with_proplist(pa_context *c, const char *name, const char *dev, pa_volume_t volume, pa_proplist *p, pa_context_play_sample_cb_t cb, void *userdata) {
+pa_operation *pa_context_play_sample_with_proplist(pa_context *c, const char *name, const char *dev, pa_volume_t volume, const pa_proplist *p, pa_context_play_sample_cb_t cb, void *userdata) {
pa_operation *o;
pa_tagstruct *t;
uint32_t tag;
@@ -237,9 +237,9 @@ pa_operation *pa_context_play_sample_with_proplist(pa_context *c, const char *na
if (p)
pa_tagstruct_put_proplist(t, p);
else {
- p = pa_proplist_new();
- pa_tagstruct_put_proplist(t, p);
- pa_proplist_free(p);
+ pa_proplist *empty_proplist = pa_proplist_new();
+ pa_tagstruct_put_proplist(t, empty_proplist);
+ pa_proplist_free(empty_proplist);
}
pa_pstream_send_tagstruct(c->pstream, t);
diff --git a/src/pulse/scache.h b/src/pulse/scache.h
index e4b82bc7e..1be719837 100644
--- a/src/pulse/scache.h
+++ b/src/pulse/scache.h
@@ -116,7 +116,7 @@ pa_operation* pa_context_play_sample_with_proplist(
const char *name /**< Name of the sample to play */,
const char *dev /**< Sink to play this sample on */,
pa_volume_t volume /**< Volume to play this sample with. Starting with 0.9.15 you may pass here PA_VOLUME_INVALID which will leave the decision about the volume to the server side, which is a good idea. */ ,
- pa_proplist *proplist /**< Property list for this sound. The property list of the cached entry will have this merged into it. */,
+ const pa_proplist *proplist /**< Property list for this sound. The property list of the cached entry will have this merged into it. */,
pa_context_play_sample_cb_t cb /**< Call this function after successfully starting playback, or NULL */,
void *userdata /**< Userdata to pass to the callback */);