summaryrefslogtreecommitdiffstats
path: root/src/pulse/introspect.c
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-05-15 13:14:33 +0100
committerColin Guthrie <colin@mageia.org>2011-05-15 13:14:33 +0100
commit26b4bd74aa92ed51a33a59af46ec32d7e5b66628 (patch)
treeba0105baedff9f796f89b31b10953748a119d644 /src/pulse/introspect.c
parentbe4208d0799f21663f58f50430b4883e87709480 (diff)
parent7ebc5033637d7f0ca8ece80259d8a5dc6b30557b (diff)
Merge branch 'passthrough'
Diffstat (limited to 'src/pulse/introspect.c')
-rw-r--r--src/pulse/introspect.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/pulse/introspect.c b/src/pulse/introspect.c
index c93fb062..e28a78c4 100644
--- a/src/pulse/introspect.c
+++ b/src/pulse/introspect.c
@@ -240,6 +240,33 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
}
}
+ if (o->context->version >= 21) {
+ i.formats = NULL;
+
+ if (pa_tagstruct_getu8(t, &i.n_formats)) {
+ pa_context_fail(o->context, PA_ERR_PROTOCOL);
+ pa_proplist_free(i.proplist);
+ goto finish;
+ }
+
+ pa_assert(i.n_formats > 0);
+ i.formats = pa_xnew0(pa_format_info*, i.n_formats);
+
+ for (j = 0; j < i.n_formats; j++) {
+ i.formats[j] = pa_format_info_new();
+ if (pa_tagstruct_get_format_info(t, i.formats[j]) < 0) {
+ do {
+ pa_format_info_free(i.formats[j]);
+ } while (j--);
+ pa_xfree(i.formats);
+
+ pa_context_fail(o->context, PA_ERR_PROTOCOL);
+ pa_proplist_free(i.proplist);
+ goto finish;
+ }
+ }
+ }
+
i.mute = (int) mute;
i.flags = (pa_sink_flags_t) flags;
i.state = (pa_sink_state_t) state;
@@ -253,6 +280,13 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
pa_xfree(i.ports[0]);
pa_xfree(i.ports);
}
+
+ if (i.formats) {
+ for (j = 0; j < i.n_formats; j++)
+ pa_format_info_free(i.formats[j]);
+ pa_xfree(i.formats);
+ }
+
pa_proplist_free(i.proplist);
}
}
@@ -999,6 +1033,7 @@ static void context_get_sink_input_info_callback(pa_pdispatch *pd, uint32_t comm
pa_zero(i);
i.proplist = pa_proplist_new();
+ i.format = pa_format_info_new();
if (pa_tagstruct_getu32(t, &i.index) < 0 ||
pa_tagstruct_gets(t, &i.name) < 0 ||
@@ -1016,10 +1051,12 @@ static void context_get_sink_input_info_callback(pa_pdispatch *pd, uint32_t comm
(o->context->version >= 13 && pa_tagstruct_get_proplist(t, i.proplist) < 0) ||
(o->context->version >= 19 && pa_tagstruct_get_boolean(t, &corked) < 0) ||
(o->context->version >= 20 && (pa_tagstruct_get_boolean(t, &has_volume) < 0 ||
- pa_tagstruct_get_boolean(t, &volume_writable) < 0))) {
+ pa_tagstruct_get_boolean(t, &volume_writable) < 0)) ||
+ (o->context->version >= 21 && pa_tagstruct_get_format_info(t, i.format) < 0)) {
pa_context_fail(o->context, PA_ERR_PROTOCOL);
pa_proplist_free(i.proplist);
+ pa_format_info_free(i.format);
goto finish;
}
@@ -1034,6 +1071,7 @@ static void context_get_sink_input_info_callback(pa_pdispatch *pd, uint32_t comm
}
pa_proplist_free(i.proplist);
+ pa_format_info_free(i.format);
}
}