]> code.delx.au - pulseaudio/blobdiff - src/modules/module-combine.c
introduce default channel map in addition to the default sample spec
[pulseaudio] / src / modules / module-combine.c
index 9fd12e30476376928886464666e8adb41b526bf4..6ed4f1413e2412efe05a0db7477afb8d4343f001 100644 (file)
@@ -233,7 +233,7 @@ static void time_callback(pa_mainloop_api*a, pa_time_event* e, const struct time
     adjust_rates(u);
 
     pa_gettimeofday(&n);
-    n.tv_sec += u->adjust_time;
+    n.tv_sec += (time_t) u->adjust_time;
     u->sink->core->mainloop->time_restart(e, &n);
 }
 
@@ -504,7 +504,7 @@ static void sink_input_state_change_cb(pa_sink_input *i, pa_sink_input_state_t s
      * we are heard right-away. */
     if (PA_SINK_INPUT_IS_LINKED(state) &&
         i->thread_info.state == PA_SINK_INPUT_INIT)
-        pa_sink_input_request_rewind(i, 0, FALSE, TRUE);
+        pa_sink_input_request_rewind(i, 0, FALSE, TRUE, TRUE);
 }
 
 /* Called from thread context */
@@ -627,6 +627,7 @@ static int sink_set_state(pa_sink *sink, pa_sink_state_t state) {
 
         case PA_SINK_UNLINKED:
         case PA_SINK_INIT:
+        case PA_SINK_INVALID_STATE:
             ;
     }
 
@@ -798,7 +799,7 @@ static int output_create_sink_input(struct output *o) {
     data.module = o->userdata->module;
     data.resample_method = o->userdata->resample_method;
 
-    o->sink_input = pa_sink_input_new(o->userdata->core, &data, PA_SINK_INPUT_VARIABLE_RATE|PA_SINK_INPUT_DONT_MOVE);
+    pa_sink_input_new(&o->sink_input, o->userdata->core, &data, PA_SINK_INPUT_VARIABLE_RATE|PA_SINK_INPUT_DONT_MOVE);
 
     pa_sink_input_new_data_done(&data);
 
@@ -1051,8 +1052,9 @@ int pa__init(pa_module*m) {
 
     slaves = pa_modargs_get_value(ma, "slaves", NULL);
     u->automatic = !slaves;
-    ss = m->core->default_sample_spec;
 
+    ss = m->core->default_sample_spec;
+    map = m->core->default_channel_map;
     if ((pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map, PA_CHANNEL_MAP_DEFAULT) < 0)) {
         pa_log("Invalid sample specification.");
         goto fail;
@@ -1103,7 +1105,7 @@ int pa__init(pa_module*m) {
         while ((n = pa_split(slaves, ",", &split_state))) {
             pa_sink *slave_sink;
 
-            if (!(slave_sink = pa_namereg_get(m->core, n, PA_NAMEREG_SINK, TRUE)) || slave_sink == u->sink) {
+            if (!(slave_sink = pa_namereg_get(m->core, n, PA_NAMEREG_SINK)) || slave_sink == u->sink) {
                 pa_log("Invalid slave sink '%s'", n);
                 pa_xfree(n);
                 goto fail;
@@ -1159,7 +1161,7 @@ int pa__init(pa_module*m) {
     if (u->adjust_time > 0) {
         struct timeval tv;
         pa_gettimeofday(&tv);
-        tv.tv_sec += u->adjust_time;
+        tv.tv_sec += (time_t) u->adjust_time;
         u->time_event = m->core->mainloop->time_new(m->core->mainloop, &tv, time_callback, u);
     }