summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/protocol-native.c
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-03-02 11:31:51 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-05-02 11:54:48 +0530
commite418e49ecbd643f3cac87438d00baaf86275927c (patch)
tree53a5290e3bf85fb4201f470b3e84a4267399cb8c /src/pulsecore/protocol-native.c
parent13229fb39e7b8cff3f114c98f8236d9123442243 (diff)
format: Avoid some code duplication
We frequently need to free an idxset containing pa_format_infos, so define an internal free function that can be used directly with this (instead of defining it once-per-file).
Diffstat (limited to 'src/pulsecore/protocol-native.c')
-rw-r--r--src/pulsecore/protocol-native.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 83321790..ee2bc4f5 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -35,6 +35,7 @@
#include <pulse/utf8.h>
#include <pulse/util.h>
#include <pulse/xmalloc.h>
+#include <pulse/internal.h>
#include <pulsecore/native-common.h>
#include <pulsecore/packet.h>
@@ -1849,10 +1850,6 @@ static pa_tagstruct *reply_new(uint32_t tag) {
return reply;
}
-static void free_format_info(pa_format_info *f, void *userdata) {
- pa_format_info_free(f);
-}
-
static void command_create_playback_stream(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
pa_native_connection *c = PA_NATIVE_CONNECTION(userdata);
playback_stream *s;
@@ -2110,7 +2107,7 @@ error:
if (p)
pa_proplist_free(p);
if (formats)
- pa_idxset_free(formats, (pa_free2_cb_t) free_format_info, NULL);
+ pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
return;
}