More fixes to problems noted by cppcheck. Some are kind of risky; some are real bugs.

This commit is contained in:
Gregory Nutt
2014-11-25 13:15:09 -06:00
parent e0fc5a86c8
commit 2994448d85
37 changed files with 156 additions and 140 deletions
+17 -17
View File
@@ -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