diff options
Diffstat (limited to 'plugins/alsa/alsa-effect-ramp.c')
-rw-r--r-- | plugins/alsa/alsa-effect-ramp.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/plugins/alsa/alsa-effect-ramp.c b/plugins/alsa/alsa-effect-ramp.c index e51879d..a3bf54b 100644 --- a/plugins/alsa/alsa-effect-ramp.c +++ b/plugins/alsa/alsa-effect-ramp.c @@ -125,12 +125,12 @@ PUBLIC int AlsaVolRampApply(SoftMixerT *mixer, AlsaSndCtlT *sndcard, AlsaStreamA if (newvol < 0) newvol = curvol - newvol; else newvol = curvol + newvol; } - + if (count != 1) { AFB_ApiError(mixer->api, "%s: mixer=%s stream=%s invalid-numeric expect {uid:%s, vol:[+,-,=]value} get vol:%s", __func__, mixer->uid, stream->uid, uid, json_object_get_string(volJ)); - goto OnErrorExit; + goto OnErrorExit; } break; case json_type_int: @@ -152,21 +152,22 @@ PUBLIC int AlsaVolRampApply(SoftMixerT *mixer, AlsaSndCtlT *sndcard, AlsaStreamA __func__, mixer->uid, stream->uid, uid, stream->volume); goto OnErrorExit; } - + // search for ramp uid in mixer AlsaVolRampT * ramp; bool found = false; cds_list_for_each_entry(ramp, &mixer->ramps.list, list) { if (ramp->uid && !strcasecmp(ramp->uid, uid)) { - break; - } - } - + found=true; + break; + } + } + if (!found) { AFB_ApiError(mixer->api, "%s: mixer=%s stream=%s ramp=%s does not exit", __func__, mixer->uid, stream->uid, uid); - goto OnErrorExit; + goto OnErrorExit; } VolRampHandleT *rHandle = calloc(1, sizeof (VolRampHandleT)); |