From 14870875385bf3821c75045bca7bcdf7f0c06c29 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Jul 30 2009 10:32:38 +0000 Subject: - Keep mixer open and not start at only %50 volume. --- diff --git a/audacious-plugins-2.1-keep-mixer-open.patch b/audacious-plugins-2.1-keep-mixer-open.patch new file mode 100644 index 0000000..6b9272c --- /dev/null +++ b/audacious-plugins-2.1-keep-mixer-open.patch @@ -0,0 +1,60 @@ +diff -Nur audacious-plugins-fedora-2.1-orig/src/alsa-ng/alsa-core.c audacious-plugins-fedora-2.1/src/alsa-ng/alsa-core.c +--- audacious-plugins-fedora-2.1-orig/src/alsa-ng/alsa-core.c 2009-07-07 00:40:36.000000000 +0200 ++++ audacious-plugins-fedora-2.1/src/alsa-ng/alsa-core.c 2009-07-30 12:08:24.000000000 +0200 +@@ -299,9 +299,22 @@ + if (alsaplug_cfg.mixer_card == NULL) + alsaplug_cfg.mixer_card = g_strdup("default"); + ++ if (!alsaplug_mixer_new(&amixer)) ++ mixer_ready = TRUE; ++ + return OUTPUT_PLUGIN_INIT_FOUND_DEVICES; + } + ++static void alsaplug_cleanup(void) ++{ ++ if (mixer_ready == TRUE) { ++ snd_mixer_detach(amixer, alsaplug_cfg.mixer_card); ++ snd_mixer_close(amixer); ++ amixer = NULL; ++ mixer_ready = FALSE; ++ } ++} ++ + static gint + alsaplug_open_audio(AFormat fmt, gint rate, gint nch) + { +@@ -316,9 +329,6 @@ + return -1; + } + +- if (!alsaplug_mixer_new(&amixer)) +- mixer_ready = TRUE; +- + if ((err = snd_pcm_open(&pcm_handle, alsaplug_cfg.pcm_device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) + { + _ERROR("snd_pcm_open: %s", snd_strerror(err)); +@@ -371,15 +381,6 @@ + g_thread_join(audio_thread); + + audio_thread = NULL; +- +- if (mixer_ready == TRUE) +- { +- snd_mixer_detach(amixer, alsaplug_cfg.mixer_card); +- snd_mixer_close(amixer); +- +- amixer = NULL; +- mixer_ready = FALSE; +- } + } + + static void +@@ -500,6 +501,7 @@ + .description = "ALSA Output Plugin (-ng)", + .probe_priority = 1, + .init = alsaplug_init, ++ .cleanup = alsaplug_cleanup, + .open_audio = alsaplug_open_audio, + .close_audio = alsaplug_close_audio, + .write_audio = alsaplug_write_audio, diff --git a/audacious-plugins.spec b/audacious-plugins.spec index 5f9459d..7f9edd1 100644 --- a/audacious-plugins.spec +++ b/audacious-plugins.spec @@ -5,7 +5,7 @@ Name: audacious-plugins Version: 2.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Plugins for the Audacious media player Group: Applications/Multimedia URL: http://audacious-media-player.org/ @@ -24,6 +24,7 @@ Source0: audacious-plugins-fedora-%{version}.tar.bz2 Patch1: audacious-plugins-1.5.1-timidity-cfg.patch Patch2: audacious-plugins-2.0.1-xmms-skindir.patch +Patch3: audacious-plugins-2.1-keep-mixer-open.patch BuildRequires: audacious-devel >= %{aud_ver} BuildRequires: jack-audio-connection-kit-devel libsamplerate-devel @@ -146,6 +147,7 @@ vortex compressed files. %patch1 -p1 -b .timidity-cfg %patch2 -p1 -b .xmms-skindir +%patch3 -p1 -b .keep-mixer-open sed -i '\,^.SILENT:,d' buildsys.mk.in @@ -229,6 +231,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jul 30 2009 Michael Schwendt - 2.1-3 +- Keep mixer open and not start at only %50 volume. + * Fri Jul 24 2009 Fedora Release Engineering - 2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild