[pulseaudio-commits] src/pavucontrol.cc src/sinkwidget.cc

Colin Guthrie colin at kemper.freedesktop.org
Thu Aug 18 09:46:48 PDT 2011


 src/pavucontrol.cc |   13 ++++++++-----
 src/sinkwidget.cc  |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit f58f0da9ebdc1bee63966b832016afccaa11d130
Author: Colin Guthrie <colin at mageia.org>
Date:   Thu Aug 18 17:43:42 2011 +0100

    Update device format stuff for (pre-release) API changes.

diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc
index 4f2f0e5..4db7d95 100644
--- a/src/pavucontrol.cc
+++ b/src/pavucontrol.cc
@@ -89,7 +89,7 @@ void card_cb(pa_context *, const pa_card_info *i, int eol, void *userdata) {
 }
 
 #if HAVE_EXT_DEVICE_RESTORE_API
-static void ext_device_restore_subscribe_cb(pa_context *c, uint32_t idx, void *userdata);
+static void ext_device_restore_subscribe_cb(pa_context *c, pa_device_type_t type, uint32_t idx, void *userdata);
 #endif
 
 void sink_cb(pa_context *c, const pa_sink_info *i, int eol, void *userdata) {
@@ -110,7 +110,7 @@ void sink_cb(pa_context *c, const pa_sink_info *i, int eol, void *userdata) {
 
 #if HAVE_EXT_DEVICE_RESTORE_API
     if (w->updateSink(*i))
-        ext_device_restore_subscribe_cb(c, i->index, w);
+        ext_device_restore_subscribe_cb(c, PA_DEVICE_TYPE_SINK, i->index, w);
 #else
     w->updateSink(*i);
 #endif
@@ -284,11 +284,14 @@ void ext_device_restore_read_cb(
     w->updateDeviceInfo(*i);
 }
 
-static void ext_device_restore_subscribe_cb(pa_context *c, uint32_t idx, void *userdata) {
+static void ext_device_restore_subscribe_cb(pa_context *c, pa_device_type_t type, uint32_t idx, void *userdata) {
     MainWindow *w = static_cast<MainWindow*>(userdata);
     pa_operation *o;
 
-    if (!(o = pa_ext_device_restore_read_sink_formats(c, idx, ext_device_restore_read_cb, w))) {
+    if (type != PA_DEVICE_TYPE_SINK)
+        return;
+
+    if (!(o = pa_ext_device_restore_read_formats(c, type, idx, ext_device_restore_read_cb, w))) {
         show_error(_("pa_ext_device_restore_read_sink_formats() failed"));
         return;
     }
@@ -533,7 +536,7 @@ void context_state_callback(pa_context *c, void *userdata) {
 
 #if HAVE_EXT_DEVICE_RESTORE_API
             /* TODO Change this to just the test function */
-            if ((o = pa_ext_device_restore_read_sink_formats_all(c, ext_device_restore_read_cb, w))) {
+            if ((o = pa_ext_device_restore_read_formats_all(c, ext_device_restore_read_cb, w))) {
                 pa_operation_unref(o);
                 n_outstanding++;
 
diff --git a/src/sinkwidget.cc b/src/sinkwidget.cc
index 6b5e86f..dc52115 100644
--- a/src/sinkwidget.cc
+++ b/src/sinkwidget.cc
@@ -182,7 +182,7 @@ void SinkWidget::onEncodingsChange() {
         }
     }
 
-    if (!(o = pa_ext_device_restore_save_sink_formats(get_context(), index, n_formats, formats, NULL, NULL))) {
+    if (!(o = pa_ext_device_restore_save_formats(get_context(), PA_DEVICE_TYPE_SINK, index, n_formats, formats, NULL, NULL))) {
         show_error(_("pa_ext_device_restore_save_sink_formats() failed"));
         free(formats);
         return;



More information about the pulseaudio-commits mailing list