[alsa-devel] [PATCH 5/9] pcm, null: use the snd_pcm_mmap_avail function

Alexander E. Patrakov patrakov at gmail.com
Sat Sep 13 20:30:17 CEST 2014


instead of the open-coded equivalent

Signed-off-by: Alexander E. Patrakov <patrakov at gmail.com>
---
 src/pcm/pcm_null.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/pcm/pcm_null.c b/src/pcm/pcm_null.c
index f11a102..0529820 100644
--- a/src/pcm/pcm_null.c
+++ b/src/pcm/pcm_null.c
@@ -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;
 }
-- 
2.1.0



More information about the Alsa-devel mailing list