From 33518d27da60db38ff20e48d61c6fda6aaa3de2b Mon Sep 17 00:00:00 2001 From: Hraban Luyat Date: Fri, 30 Dec 2016 22:32:09 +0000 Subject: [PATCH] No local var in bridge functions --- encoder.go | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/encoder.go b/encoder.go index cccb26a..3ad8330 100644 --- a/encoder.go +++ b/encoder.go @@ -31,7 +31,7 @@ opus_int32 bridge_encoder_get_sample_rate(OpusEncoder *st) { opus_int32 sample_rate = 0; - opus_encoder_ctl(st, OPUS_GET_SAMPLE_RATE(&sample_rate)); + int ret = opus_encoder_ctl(st, OPUS_GET_SAMPLE_RATE(&sample_rate)); return sample_rate; } @@ -39,49 +39,37 @@ bridge_encoder_get_sample_rate(OpusEncoder *st) int bridge_encoder_set_bitrate(OpusEncoder *st, opus_int32 bitrate) { - int res; - res = opus_encoder_ctl(st, OPUS_SET_BITRATE(bitrate)); - return res; + return opus_encoder_ctl(st, OPUS_SET_BITRATE(bitrate)); } int bridge_encoder_get_bitrate(OpusEncoder *st, opus_int32 *bitrate) { - int res; - res = opus_encoder_ctl(st, OPUS_GET_BITRATE(bitrate)); - return res; + return opus_encoder_ctl(st, OPUS_GET_BITRATE(bitrate)); } int bridge_encoder_set_complexity(OpusEncoder *st, opus_int32 complexity) { - int res; - res = opus_encoder_ctl(st, OPUS_SET_COMPLEXITY(complexity)); - return res; + return opus_encoder_ctl(st, OPUS_SET_COMPLEXITY(complexity)); } int bridge_encoder_get_complexity(OpusEncoder *st, opus_int32 *complexity) { - int res; - res = opus_encoder_ctl(st, OPUS_GET_COMPLEXITY(complexity)); - return res; + return opus_encoder_ctl(st, OPUS_GET_COMPLEXITY(complexity)); } int bridge_encoder_set_max_bandwidth(OpusEncoder *st, opus_int32 max_bw) { - int res; - res = opus_encoder_ctl(st, OPUS_SET_MAX_BANDWIDTH(max_bw)); - return res; + return opus_encoder_ctl(st, OPUS_SET_MAX_BANDWIDTH(max_bw)); } int bridge_encoder_get_max_bandwidth(OpusEncoder *st, opus_int32 *max_bw) { - int res; - res = opus_encoder_ctl(st, OPUS_GET_MAX_BANDWIDTH(max_bw)); - return res; + return opus_encoder_ctl(st, OPUS_GET_MAX_BANDWIDTH(max_bw)); } // Access the preprocessor from CGO -- 2.48.1