From 8bcadcb2a6ea6288f5cc38ea076b5bda48990ac9 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 30 Oct 2003 18:46:32 +0000 Subject: [PATCH] - fixed the calculation of snd_pcm_avail() with plugin. this will fix the slow playback problem on mplayer. - the delay calculation is optimized a bit. --- src/pcm/pcm_plugin.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c index 2ae0e757..d7d7d810 100644 --- a/src/pcm/pcm_plugin.c +++ b/src/pcm/pcm_plugin.c @@ -622,8 +622,10 @@ int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status) } status->appl_ptr = *pcm->appl.ptr; status->hw_ptr = *pcm->hw.ptr; - status->avail = pcm->buffer_size; - snd_pcm_plugin_delay(pcm, &status->delay); + if (plugin->client_frames) { + status->delay = plugin->client_frames(pcm, status->delay); + status->avail = plugin->client_frames(pcm, status->avail); + } if (!snd_atomic_read_ok(&ratom)) { snd_atomic_read_wait(&ratom); goto _again; -- 2.47.1