]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm, null: use the snd_pcm_mmap_avail function
authorAlexander E. Patrakov <patrakov@gmail.com>
Sat, 13 Sep 2014 18:30:17 +0000 (00:30 +0600)
committerJaroslav Kysela <perex@perex.cz>
Sat, 13 Sep 2014 19:04:52 +0000 (21:04 +0200)
instead of the open-coded equivalent

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_null.c

index f11a1020f7e309201cee7cf50c4ec818919fe596..05298200ac0a26ea1cf3aef2ef86a8fa6f0e4423 100644 (file)
@@ -86,10 +86,7 @@ static snd_pcm_sframes_t snd_pcm_null_avail_update(snd_pcm_t *pcm)
         if (null->state == SND_PCM_STATE_PREPARED) {
                 /* it is required to return the correct avail count for */
                 /* the prepared stream, otherwise the start is not called */
-                if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
-                        return snd_pcm_mmap_playback_avail(pcm);
-                else
-                        return snd_pcm_mmap_capture_avail(pcm);
+                return snd_pcm_mmap_avail(pcm);
         }
        return pcm->buffer_size;
 }