From 084e7a91d86db87b8ef438fd15f7823efebc0454 Mon Sep 17 00:00:00 2001 From: "Alexander E. Patrakov" Date: Thu, 12 Jun 2014 16:34:24 +0600 Subject: [PATCH] pcm: null: add rewindable and forwardable callbacks Dirty, but consistent with avail_update. Signed-off-by: Alexander E. Patrakov Signed-off-by: Jaroslav Kysela --- src/pcm/pcm_null.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pcm/pcm_null.c b/src/pcm/pcm_null.c index a154a5cd..f1d2f91f 100644 --- a/src/pcm/pcm_null.c +++ b/src/pcm/pcm_null.c @@ -168,6 +168,17 @@ static int snd_pcm_null_pause(snd_pcm_t *pcm, int enable) return 0; } +static snd_pcm_sframes_t snd_pcm_null_rewindable(snd_pcm_t *pcm) +{ + return pcm->buffer_size; +} + +static snd_pcm_sframes_t snd_pcm_null_forwardable(snd_pcm_t *pcm ATTRIBUTE_UNUSED) +{ + return 0; +} + + static snd_pcm_sframes_t snd_pcm_null_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames) { snd_pcm_null_t *null = pcm->private_data; @@ -325,7 +336,9 @@ static const snd_pcm_fast_ops_t snd_pcm_null_fast_ops = { .drop = snd_pcm_null_drop, .drain = snd_pcm_null_drain, .pause = snd_pcm_null_pause, + .rewindable = snd_pcm_null_rewindable, .rewind = snd_pcm_null_rewind, + .forwardable = snd_pcm_null_forwardable, .forward = snd_pcm_null_forward, .resume = snd_pcm_null_resume, .writei = snd_pcm_null_writei, -- 2.47.1