|
|
1487087 |
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
|
|
|
1487087 |
--- audacious-plugins-fedora-2.1-orig/src/alsa-ng/alsa-core.c 2009-07-07 00:40:36.000000000 +0200
|
|
|
1487087 |
+++ audacious-plugins-fedora-2.1/src/alsa-ng/alsa-core.c 2009-07-30 12:08:24.000000000 +0200
|
|
|
1487087 |
@@ -299,9 +299,22 @@
|
|
|
1487087 |
if (alsaplug_cfg.mixer_card == NULL)
|
|
|
1487087 |
alsaplug_cfg.mixer_card = g_strdup("default");
|
|
|
1487087 |
|
|
|
1487087 |
+ if (!alsaplug_mixer_new(&amixer))
|
|
|
1487087 |
+ mixer_ready = TRUE;
|
|
|
1487087 |
+
|
|
|
1487087 |
return OUTPUT_PLUGIN_INIT_FOUND_DEVICES;
|
|
|
1487087 |
}
|
|
|
1487087 |
|
|
|
1487087 |
+static void alsaplug_cleanup(void)
|
|
|
1487087 |
+{
|
|
|
1487087 |
+ if (mixer_ready == TRUE) {
|
|
|
1487087 |
+ snd_mixer_detach(amixer, alsaplug_cfg.mixer_card);
|
|
|
1487087 |
+ snd_mixer_close(amixer);
|
|
|
1487087 |
+ amixer = NULL;
|
|
|
1487087 |
+ mixer_ready = FALSE;
|
|
|
1487087 |
+ }
|
|
|
1487087 |
+}
|
|
|
1487087 |
+
|
|
|
1487087 |
static gint
|
|
|
1487087 |
alsaplug_open_audio(AFormat fmt, gint rate, gint nch)
|
|
|
1487087 |
{
|
|
|
1487087 |
@@ -316,9 +329,6 @@
|
|
|
1487087 |
return -1;
|
|
|
1487087 |
}
|
|
|
1487087 |
|
|
|
1487087 |
- if (!alsaplug_mixer_new(&amixer))
|
|
|
1487087 |
- mixer_ready = TRUE;
|
|
|
1487087 |
-
|
|
|
1487087 |
if ((err = snd_pcm_open(&pcm_handle, alsaplug_cfg.pcm_device, SND_PCM_STREAM_PLAYBACK, 0)) < 0)
|
|
|
1487087 |
{
|
|
|
1487087 |
_ERROR("snd_pcm_open: %s", snd_strerror(err));
|
|
|
1487087 |
@@ -371,15 +381,6 @@
|
|
|
1487087 |
g_thread_join(audio_thread);
|
|
|
1487087 |
|
|
|
1487087 |
audio_thread = NULL;
|
|
|
1487087 |
-
|
|
|
1487087 |
- if (mixer_ready == TRUE)
|
|
|
1487087 |
- {
|
|
|
1487087 |
- snd_mixer_detach(amixer, alsaplug_cfg.mixer_card);
|
|
|
1487087 |
- snd_mixer_close(amixer);
|
|
|
1487087 |
-
|
|
|
1487087 |
- amixer = NULL;
|
|
|
1487087 |
- mixer_ready = FALSE;
|
|
|
1487087 |
- }
|
|
|
1487087 |
}
|
|
|
1487087 |
|
|
|
1487087 |
static void
|
|
|
1487087 |
@@ -500,6 +501,7 @@
|
|
|
1487087 |
.description = "ALSA Output Plugin (-ng)",
|
|
|
1487087 |
.probe_priority = 1,
|
|
|
1487087 |
.init = alsaplug_init,
|
|
|
1487087 |
+ .cleanup = alsaplug_cleanup,
|
|
|
1487087 |
.open_audio = alsaplug_open_audio,
|
|
|
1487087 |
.close_audio = alsaplug_close_audio,
|
|
|
1487087 |
.write_audio = alsaplug_write_audio,
|