- 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.
This commit is contained in:
Takashi Iwai 2003-10-30 18:46:32 +00:00
parent a2101162a8
commit 8bcadcb2a6

View file

@ -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->appl_ptr = *pcm->appl.ptr;
status->hw_ptr = *pcm->hw.ptr; status->hw_ptr = *pcm->hw.ptr;
status->avail = pcm->buffer_size; if (plugin->client_frames) {
snd_pcm_plugin_delay(pcm, &status->delay); status->delay = plugin->client_frames(pcm, status->delay);
status->avail = plugin->client_frames(pcm, status->avail);
}
if (!snd_atomic_read_ok(&ratom)) { if (!snd_atomic_read_ok(&ratom)) {
snd_atomic_read_wait(&ratom); snd_atomic_read_wait(&ratom);
goto _again; goto _again;