]> git.alsa-project.org Git - alsa-lib.git/commitdiff
- fixed the calculation of snd_pcm_avail() with plugin.
authorTakashi Iwai <tiwai@suse.de>
Thu, 30 Oct 2003 18:46:32 +0000 (18:46 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 30 Oct 2003 18:46:32 +0000 (18:46 +0000)
  this will fix the slow playback problem on mplayer.
- the delay calculation is optimized a bit.

src/pcm/pcm_plugin.c

index 2ae0e75751ff6fa8eff27e3acd8217e5ce62b2a5..d7d7d8102b5eaa7b61e1b7ccc1dbe4c73a8efd5f 100644 (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->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;