summaryrefslogtreecommitdiff
path: root/nuttx/audio
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/audio')
-rw-r--r--nuttx/audio/pcm_decode.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/nuttx/audio/pcm_decode.c b/nuttx/audio/pcm_decode.c
index 14e228a6d..b8808a2cb 100644
--- a/nuttx/audio/pcm_decode.c
+++ b/nuttx/audio/pcm_decode.c
@@ -442,8 +442,8 @@ static void pcm_subsample_configure(FAR struct pcm_decode_s *priv,
if (priv->subsample == AUDIO_SUBSAMPLE_NONE)
{
- /* Ignore request to stop fast forwarding if we are already
- * fast forwarding.
+ /* Ignore request to stop fast forwarding if we are already playing
+ * normally.
*/
if (subsample != AUDIO_SUBSAMPLE_NONE)
@@ -460,24 +460,11 @@ static void pcm_subsample_configure(FAR struct pcm_decode_s *priv,
}
}
- /* 2. Were already fast forwarding and we have been asked to change the
- * sub-sampling rate.
- */
-
- else if (subsample != AUDIO_SUBSAMPLE_NONE)
- {
- /* Just save the current subsample setting. It will take effect
- * on the next audio buffer that we receive.
- */
-
- priv->subsample = subsample;
- }
-
- /* 3. We were already fast forwarding and we have been asked to return to
+ /* 2. We were already fast forwarding and we have been asked to return to
* normal play.
*/
- else if (subsample != AUDIO_SUBSAMPLE_NONE)
+ else if (subsample == AUDIO_SUBSAMPLE_NONE)
{
audvdbg("Stop sub-sampling\n");
@@ -489,6 +476,19 @@ static void pcm_subsample_configure(FAR struct pcm_decode_s *priv,
priv->skip = 0;
priv->subsample = AUDIO_SUBSAMPLE_NONE;
}
+
+ /* 3. Were already fast forwarding and we have been asked to change the
+ * sub-sampling rate.
+ */
+
+ else if (priv->subsample != subsample)
+ {
+ /* Just save the new subsample setting. It will take effect on the
+ * next audio buffer that we receive.
+ */
+
+ priv->subsample = subsample;
+ }
}
#endif