diff --git a/audacious-plugins-1.5.1-pulseaudio-volume.patch b/audacious-plugins-1.5.1-pulseaudio-volume.patch deleted file mode 100644 index de881d7..0000000 --- a/audacious-plugins-1.5.1-pulseaudio-volume.patch +++ /dev/null @@ -1,36 +0,0 @@ -There is no callback feature in Audacious < 2.2 that moves the UI's volume -slider when external volume controls are used. Hence stick to the internal -volume level and don't get confused when trying to save/restore external -volume levels. - -diff -Nur audacious-plugins-1.5.1-orig/src/pulse_audio/pulse_audio.c audacious-plugins-1.5.1/src/pulse_audio/pulse_audio.c ---- audacious-plugins-1.5.1-orig/src/pulse_audio/pulse_audio.c 2008-05-24 00:44:20.000000000 +0200 -+++ audacious-plugins-1.5.1/src/pulse_audio/pulse_audio.c 2009-10-19 16:46:47.527799161 +0200 -@@ -83,6 +83,8 @@ - } - - static void info_cb(struct pa_context *c, const struct pa_sink_input_info *i, int is_last, void *userdata) { -+ return; /* we don't do anything useful with this callback */ -+ - assert(c); - - if (!i) -@@ -685,6 +687,18 @@ - goto unlock_and_fail; - } - -+ pa_operation_unref(o); -+ /* set initial volume */ -+ if (!(o = pa_context_set_sink_input_volume(context, pa_stream_get_index(stream), &volume, NULL, NULL))) { -+ g_warning("pa_context_set_sink_input_volume() failed: %s", pa_strerror(pa_context_errno(context))); -+ goto unlock_and_fail; -+ } -+ while (pa_operation_get_state(o) != PA_OPERATION_DONE) { -+ CHECK_DEAD_GOTO(fail, 1); -+ pa_threaded_mainloop_wait(mainloop); -+ } -+ pa_operation_unref(o); -+ - do_trigger = 0; - written = 0; - time_offset_msec = 0; diff --git a/audacious-plugins-2.1-pulseaudio-volume-accuracy.patch b/audacious-plugins-2.1-pulseaudio-volume-accuracy.patch new file mode 100644 index 0000000..0c9e837 --- /dev/null +++ b/audacious-plugins-2.1-pulseaudio-volume-accuracy.patch @@ -0,0 +1,31 @@ +diff -Nur audacious-plugins-fedora-2.1-pulseaudio/src/pulse_audio/pulse_audio.c audacious-plugins-fedora-2.1-pulseaudio-volume-accuracy/src/pulse_audio/pulse_audio.c +--- audacious-plugins-fedora-2.1-pulseaudio/src/pulse_audio/pulse_audio.c 2009-10-21 22:44:06.149809732 +0200 ++++ audacious-plugins-fedora-2.1-pulseaudio-volume-accuracy/src/pulse_audio/pulse_audio.c 2009-10-21 22:45:28.048813828 +0200 +@@ -38,6 +38,7 @@ + + static pa_cvolume volume; + static int volume_valid = 0; ++static int save_volume_l = 0, save_volume_r = 0; + + static int do_trigger = 0; + static uint64_t written = 0; +@@ -197,8 +198,8 @@ + + if (b) { + if (v.channels == 2) { +- *l = (int) ((v.values[0]*100)/PA_VOLUME_NORM); +- *r = (int) ((v.values[1]*100)/PA_VOLUME_NORM); ++ *l = save_volume_l; ++ *r = save_volume_r; + } else + *l = *r = (int) ((pa_cvolume_avg(&v)*100)/PA_VOLUME_NORM); + } +@@ -219,6 +220,8 @@ + } + + static void pulse_set_volume(int l, int r) { ++ save_volume_l = l; ++ save_volume_r = r; + + if (connected) { + pa_threaded_mainloop_lock(mainloop); diff --git a/audacious-plugins-2.1-pulseaudio-volume.patch b/audacious-plugins-2.1-pulseaudio-volume.patch new file mode 100644 index 0000000..b8b3553 --- /dev/null +++ b/audacious-plugins-2.1-pulseaudio-volume.patch @@ -0,0 +1,36 @@ +There is no callback feature in Audacious < 2.2 that moves the UI's volume +slider when external volume controls are used. Hence stick to the internal +volume level and don't get confused when trying to save/restore external +volume levels. + +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 +--- audacious-plugins-fedora-2.1-orig/src/pulse_audio/pulse_audio.c 2009-07-07 00:40:36.000000000 +0200 ++++ audacious-plugins-fedora-2.1-pulseaudio/src/pulse_audio/pulse_audio.c 2009-10-21 22:44:06.149809732 +0200 +@@ -80,6 +80,8 @@ + } + + static void info_cb(struct pa_context *c, const struct pa_sink_input_info *i, int is_last, void *userdata) { ++ return; /* we don't do anything useful with this callback */ ++ + assert(c); + + if (!i) +@@ -709,6 +711,18 @@ + goto unlock_and_fail; + } + ++ pa_operation_unref(o); ++ /* set initial volume */ ++ if (!(o = pa_context_set_sink_input_volume(context, pa_stream_get_index(stream), &volume, NULL, NULL))) { ++ g_warning("pa_context_set_sink_input_volume() failed: %s", pa_strerror(pa_context_errno(context))); ++ goto unlock_and_fail; ++ } ++ while (pa_operation_get_state(o) != PA_OPERATION_DONE) { ++ CHECK_DEAD_GOTO(fail, 1); ++ pa_threaded_mainloop_wait(mainloop); ++ } ++ pa_operation_unref(o); ++ + do_trigger = 0; + written = 0; + time_offset_msec = 0; diff --git a/audacious-plugins.spec b/audacious-plugins.spec index fc9fb14..a299bc8 100644 --- a/audacious-plugins.spec +++ b/audacious-plugins.spec @@ -5,7 +5,7 @@ Name: audacious-plugins Version: 2.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Plugins for the Audacious media player Group: Applications/Multimedia URL: http://audacious-media-player.org/ @@ -26,7 +26,8 @@ Patch1: audacious-plugins-1.5.1-timidity-cfg.patch Patch2: audacious-plugins-2.0.1-xmms-skindir.patch Patch3: audacious-plugins-2.1-alsa-ng.patch Patch4: audacious-plugins-2.1-underruns.patch -Patch5: audacious-plugins-1.5.1-pulseaudio-volume.patch +Patch5: audacious-plugins-2.1-pulseaudio-volume.patch +Patch6: audacious-plugins-2.1-pulseaudio-volume-accuracy.patch BuildRequires: audacious-devel >= %{aud_ver} BuildRequires: jack-audio-connection-kit-devel libsamplerate-devel @@ -152,6 +153,7 @@ vortex compressed files. %patch3 -p1 -b .alsa-ng %patch4 -p1 -b .underruns %patch5 -p1 -b .pulseaudio-volume +%patch6 -p1 -b .pulseaudio-volume-accuracy sed -i '\,^.SILENT:,d' buildsys.mk.in @@ -235,6 +237,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Oct 21 2009 Michael Schwendt - 2.1-7 +- Patch pulseaudio plugin to not suffer from precision loss when + calculating the volume level to save. + * Wed Oct 21 2009 Michael Schwendt - 2.1-6 - Rediff the underruns patch and set buffer_time_min.