summaryrefslogtreecommitdiff
path: root/nuttx/audio
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-25 13:15:09 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-25 13:15:09 -0600
commit3b3fcf2bfa6015d890d42b5a528f7fe7476632f7 (patch)
treecccc4fca1d7d91915ad679577b484c5c6a110e6d /nuttx/audio
parentc9b18b049b09580260188349bb32e91b59f74965 (diff)
downloadnuttx-3b3fcf2bfa6015d890d42b5a528f7fe7476632f7.tar.gz
nuttx-3b3fcf2bfa6015d890d42b5a528f7fe7476632f7.tar.bz2
nuttx-3b3fcf2bfa6015d890d42b5a528f7fe7476632f7.zip
More fixes to problems noted by cppcheck. Some are kind of risky; some are real bugs.
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