diff --git a/audacious-plugins-2.1-underruns.patch b/audacious-plugins-2.1-underruns.patch index 363a0c5..1cd684e 100644 --- a/audacious-plugins-2.1-underruns.patch +++ b/audacious-plugins-2.1-underruns.patch @@ -1,6 +1,6 @@ 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-10-21 13:18:35.825170784 +0200 -+++ audacious-plugins-fedora-2.1/src/alsa-ng/alsa-core.c 2009-10-21 13:20:45.520178677 +0200 ++++ audacious-plugins-fedora-2.1/src/alsa-ng/alsa-core.c 2009-10-26 12:19:30.561386114 +0100 @@ -27,6 +27,10 @@ static gboolean pcm_going = FALSE; static GThread *audio_thread = NULL; @@ -69,23 +69,43 @@ diff -Nur audacious-plugins-fedora-2.1-orig/src/alsa-ng/alsa-core.c audacious-pl } snd_pcm_drain(pcm_handle); -@@ -339,6 +360,7 @@ - gint err, bitwidth, ringbuf_size, buf_size; +@@ -336,9 +357,10 @@ + static gint + alsaplug_open_audio(AFormat fmt, gint rate, gint nch) + { +- gint err, bitwidth, ringbuf_size, buf_size; ++ gint err, bitwidth, ringbuf_size, buf_size, buf_size_norm; snd_pcm_format_t afmt; snd_pcm_hw_params_t *hwparams = NULL; -+ guint time = 1000 * 100; ++ guint buf_time_min; afmt = alsaplug_format_convert(fmt); if (afmt == SND_PCM_FORMAT_UNKNOWN) -@@ -365,6 +387,7 @@ +@@ -354,6 +376,10 @@ + return -1; + } + ++ buf_size = MAX(aud_cfg->output_buffer_size, 100); ++ buf_size_norm = MAX(buf_size-400, 100); ++ buf_time_min = buf_size_norm * 1000; ++ + snd_pcm_hw_params_alloca(&hwparams); + snd_pcm_hw_params_any(pcm_handle, hwparams); + +@@ -365,18 +391,25 @@ "snd_pcm_hw_params_set_channels"); CHECK_FAIL (snd_pcm_hw_params_set_rate (pcm_handle, hwparams, rate, 0), "snd_pcm_hw_params_set_rate"); -+ snd_pcm_hw_params_set_buffer_time_min (pcm_handle, hwparams, &time, 0); ++ snd_pcm_hw_params_set_buffer_time_min (pcm_handle, hwparams, &buf_time_min, 0); CHECK_FAIL (snd_pcm_hw_params (pcm_handle, hwparams), "snd_pcm_hw_params"); bitwidth = snd_pcm_format_physical_width(afmt); -@@ -377,6 +400,13 @@ + bps = (rate * bitwidth * nch) >> 3; + +- buf_size = MAX(aud_cfg->output_buffer_size, 100); + ringbuf_size = buf_size * bps / 1000; + + if (alsaplug_ringbuffer_init(&pcm_ringbuf, ringbuf_size) == -1) { _ERROR("alsaplug_ringbuffer_init failed"); return -1; } @@ -99,7 +119,7 @@ diff -Nur audacious-plugins-fedora-2.1-orig/src/alsa-ng/alsa-core.c audacious-pl pcm_going = TRUE; flush_request = -1; -@@ -511,6 +541,7 @@ +@@ -511,6 +544,7 @@ { g_mutex_lock (pcm_state_mutex); paused = p; diff --git a/audacious-plugins.spec b/audacious-plugins.spec index d0c2b47..a46f3fc 100644 --- a/audacious-plugins.spec +++ b/audacious-plugins.spec @@ -5,7 +5,7 @@ Name: audacious-plugins Version: 2.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Plugins for the Audacious media player Group: Applications/Multimedia URL: http://audacious-media-player.org/ @@ -239,6 +239,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Oct 26 2009 Michael Schwendt - 2.1-9 +- Let buffer_time_min in underruns patch depend on default buffer size. + * Sun Oct 25 2009 Michael Schwendt - 2.1-8 - Patch modplug plugin to remove old cruft and fix playback.