Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37735142
en ru br
Репозитории ALT
S:4.3.1-alt1
5.1: 2.2-alt0.M50P.1
4.1: 1.4.5-alt2
4.0: 1.3.5-alt3
www.altlinux.org/Changes

Другие репозитории
Upstream:1.5.0

Группа :: Звук
Пакет: audacious-plugins

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: audacious-plugins-2.1-keep-mixer-open.patch
Скачать


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,
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin