modules:mixer:pulse Update default sink
authorFlavio Ceolin <flavio.ceolin@gmail.com>
Sun, 26 Jul 2015 23:33:07 +0000 (20:33 -0300)
committerFlavio Ceolin <flavio.ceolin@gmail.com>
Fri, 7 Aug 2015 19:53:51 +0000 (16:53 -0300)
Update the default sink when it changes (for instance when it is changed
on pavucontrol).

src/modules/mixer/lib/backends/pulseaudio/pulse.c

index 382ccfcdfe32c24ffcacc89f6bf9e706401ad7c9..a00ffb0dad6cd597e91440800467cd778d22b9d7 100644 (file)
@@ -648,7 +648,15 @@ _subscribe_cb(pa_context *c, pa_subscription_event_type_t t,
             pa_operation_unref(o);
          }
        break;
-
+    case PA_SUBSCRIPTION_EVENT_SERVER:
+       if (!(o = pa_context_get_server_info(c, _server_info_cb,
+                                            data)))
+         {
+            ERR("pa_context_get_server_info() failed");
+            return;
+         }
+       pa_operation_unref(o);
+       break;
     default:
        WRN("Event not handled");
        break;