bac4923
There is no callback feature in Audacious < 2.2 that moves the UI's volume
bac4923
slider when external volume controls are used. Hence stick to the internal
bac4923
volume level and don't get confused when trying to save/restore external
bac4923
volume levels.
bac4923
79612b6
diff -Nur audacious-plugins-fedora-2.1-orig/src/pulse_audio/pulse_audio.c audacious-plugins-fedora-2.1-pulseaudio/src/pulse_audio/pulse_audio.c
79612b6
--- audacious-plugins-fedora-2.1-orig/src/pulse_audio/pulse_audio.c	2009-07-07 00:40:36.000000000 +0200
79612b6
+++ audacious-plugins-fedora-2.1-pulseaudio/src/pulse_audio/pulse_audio.c	2009-10-21 22:44:06.149809732 +0200
79612b6
@@ -80,6 +80,8 @@
bac4923
 }
bac4923
 
bac4923
 static void info_cb(struct pa_context *c, const struct pa_sink_input_info *i, int is_last, void *userdata) {
bac4923
+    return;  /* we don't do anything useful with this callback */
bac4923
+
bac4923
     assert(c);
bac4923
 
bac4923
     if (!i)
79612b6
@@ -709,6 +711,18 @@
bac4923
         goto unlock_and_fail;
bac4923
     }
bac4923
 
bac4923
+    pa_operation_unref(o);
bac4923
+    /* set initial volume */
bac4923
+    if (!(o = pa_context_set_sink_input_volume(context, pa_stream_get_index(stream), &volume, NULL, NULL))) {
bac4923
+        g_warning("pa_context_set_sink_input_volume() failed: %s", pa_strerror(pa_context_errno(context)));
bac4923
+        goto unlock_and_fail;
bac4923
+    }
bac4923
+    while (pa_operation_get_state(o) != PA_OPERATION_DONE) {
bac4923
+        CHECK_DEAD_GOTO(fail, 1);
bac4923
+        pa_threaded_mainloop_wait(mainloop);
bac4923
+    }
bac4923
+    pa_operation_unref(o);
bac4923
+
bac4923
     do_trigger = 0;
bac4923
     written = 0;
bac4923
     time_offset_msec = 0;