summaryrefslogtreecommitdiff
path: root/nuttx/drivers/audio
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-27 18:33:17 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-27 18:33:17 -0600
commitcb8b8b6c6529e93968af3190174eb143f06ff8fd (patch)
treeabde43d641f3f51f0893e1e81ba060f60f7a8b75 /nuttx/drivers/audio
parent7203e1148956421eef1bdc98741775d0069a5e46 (diff)
downloadnuttx-cb8b8b6c6529e93968af3190174eb143f06ff8fd.tar.gz
nuttx-cb8b8b6c6529e93968af3190174eb143f06ff8fd.tar.bz2
nuttx-cb8b8b6c6529e93968af3190174eb143f06ff8fd.zip
PCM: First cut at fast forward by subsampling
Diffstat (limited to 'nuttx/drivers/audio')
-rw-r--r--nuttx/drivers/audio/audio_null.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/nuttx/drivers/audio/audio_null.c b/nuttx/drivers/audio/audio_null.c
index 526e8d204..e753f5171 100644
--- a/nuttx/drivers/audio/audio_null.c
+++ b/nuttx/drivers/audio/audio_null.c
@@ -649,18 +649,27 @@ static int null_resume(FAR struct audio_lowerhalf_s *dev)
static int null_enqueuebuffer(FAR struct audio_lowerhalf_s *dev,
FAR struct ap_buffer_s *apb)
{
- /* Take a reference */
+ FAR struct null_dev_s *priv = (FAR struct null_dev_s *)dev;
- apb_reference(apb);
audvdbg("apb=%p curbyte=%d nbytes=%d\n", apb, apb->curbyte, apb->nbytes);
- /* say that we consumed all of the data */
+ /* Say that we consumed all of the data */
apb->curbyte = apb->nbytes;
- /* Release the reference and return success */
+ /* And return the buffer to the upper level */
+
+ DEBUGASSERT(priv && apb && priv->dev.upper);
+
+ /* The buffer belongs to to an upper level. Just forward the event to
+ * the next level up.
+ */
- apb_free(apb);
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+ priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK, NULL);
+#else
+ priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK);
+#endif
audvdbg("Return OK\n");
return OK;