]> code.delx.au - pulseaudio/blobdiff - src/pulse/introspect.c
introduce default channel map in addition to the default sample spec
[pulseaudio] / src / pulse / introspect.c
index 1d50939cfe311435f2bf3ce6a47d2a9bfddeb7da..befeb242fe201f79e33715337c8156f6324975be 100644 (file)
@@ -110,12 +110,17 @@ static void context_get_server_info_callback(pa_pdispatch *pd, uint32_t command,
                pa_tagstruct_gets(t, &i.default_sink_name) < 0 ||
                pa_tagstruct_gets(t, &i.default_source_name) < 0 ||
                pa_tagstruct_getu32(t, &i.cookie) < 0 ||
+               (o->context->version >= 15 &&
+                pa_tagstruct_get_channel_map(t, &i.channel_map) < 0) ||
                !pa_tagstruct_eof(t)) {
 
         pa_context_fail(o->context, PA_ERR_PROTOCOL);
         goto finish;
     }
 
+    if (p && o->context->version < 15)
+        pa_channel_map_init_extend(&i.channel_map, i.sample_spec.channels, PA_CHANNEL_MAP_DEFAULT);
+
     if (o->callback) {
         pa_server_info_cb_t cb = (pa_server_info_cb_t) o->callback;
         cb(o->context, p, o->userdata);
@@ -162,6 +167,7 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
             i.n_volume_steps = PA_VOLUME_NORM+1;
             mute = FALSE;
             state = PA_SINK_INVALID_STATE;
+            i.card = PA_INVALID_INDEX;
 
             if (pa_tagstruct_getu32(t, &i.index) < 0 ||
                 pa_tagstruct_gets(t, &i.name) < 0 ||
@@ -182,7 +188,8 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
                 (o->context->version >= 15 &&
                  (pa_tagstruct_get_volume(t, &i.base_volume) < 0 ||
                   pa_tagstruct_getu32(t, &state) < 0 ||
-                  pa_tagstruct_getu32(t, &i.n_volume_steps) < 0))) {
+                  pa_tagstruct_getu32(t, &i.n_volume_steps) < 0 ||
+                  pa_tagstruct_getu32(t, &i.card) < 0))) {
 
                 pa_context_fail(o->context, PA_ERR_PROTOCOL);
                 pa_proplist_free(i.proplist);
@@ -293,6 +300,7 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
             i.n_volume_steps = PA_VOLUME_NORM+1;
             mute = FALSE;
             state = PA_SOURCE_INVALID_STATE;
+            i.card = PA_INVALID_INDEX;
 
             if (pa_tagstruct_getu32(t, &i.index) < 0 ||
                 pa_tagstruct_gets(t, &i.name) < 0 ||
@@ -313,7 +321,8 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
                 (o->context->version >= 15 &&
                  (pa_tagstruct_get_volume(t, &i.base_volume) < 0 ||
                   pa_tagstruct_getu32(t, &state) < 0 ||
-                  pa_tagstruct_getu32(t, &i.n_volume_steps) < 0))) {
+                  pa_tagstruct_getu32(t, &i.n_volume_steps) < 0 ||
+                  pa_tagstruct_getu32(t, &i.card) < 0))) {
 
                 pa_context_fail(o->context, PA_ERR_PROTOCOL);
                 pa_proplist_free(i.proplist);
@@ -517,7 +526,9 @@ static void context_get_card_info_callback(pa_pdispatch *pd, uint32_t command, u
                 for (j = 0; j < i.n_profiles; j++) {
 
                     if (pa_tagstruct_gets(t, &i.profiles[j].name) < 0 ||
-                        pa_tagstruct_gets(t, &i.profiles[j].description) < 0) {
+                        pa_tagstruct_gets(t, &i.profiles[j].description) < 0 ||
+                        pa_tagstruct_getu32(t, &i.profiles[j].n_sinks) < 0 ||
+                        pa_tagstruct_getu32(t, &i.profiles[j].n_sources)< 0) {
 
                         pa_context_fail(o->context, PA_ERR_PROTOCOL);
                         pa_xfree(i.profiles);