summaryrefslogtreecommitdiff
path: root/libavfilter/vf_sr.c
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-06-01 11:28:56 +0800
committerJun Zhao <barryjzhao@tencent.com>2019-06-03 13:04:23 +0800
commit0b7bfa8ad79e483fd81fc006b35c4ef86990d46f (patch)
tree0ace2cdbb1e949d31669baf85acc8a0f9b1bb256 /libavfilter/vf_sr.c
parent5c1fbc42397b26fe77abbd7e2ae604d57274ac35 (diff)
downloadffmpeg-0b7bfa8ad79e483fd81fc006b35c4ef86990d46f.tar.gz
lavf/sr: Refine the coding style for init
We perfer the coding style like: /* some stuff */ if (error) { /* error handling */ return -(errorcode); } /* normal actions */ do_something() Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavfilter/vf_sr.c')
-rw-r--r--libavfilter/vf_sr.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c
index 0be572ff9d..0433246e26 100644
--- a/libavfilter/vf_sr.c
+++ b/libavfilter/vf_sr.c
@@ -72,17 +72,16 @@ static av_cold int init(AVFilterContext *context)
av_log(context, AV_LOG_ERROR, "could not create DNN module for requested backend\n");
return AVERROR(ENOMEM);
}
+
if (!sr_context->model_filename){
av_log(context, AV_LOG_ERROR, "model file for network was not specified\n");
return AVERROR(EIO);
- } else {
- if (!sr_context->dnn_module->load_model) {
- av_log(context, AV_LOG_ERROR, "load_model for network was not specified\n");
- return AVERROR(EIO);
- } else {
- sr_context->model = (sr_context->dnn_module->load_model)(sr_context->model_filename);
- }
}
+ if (!sr_context->dnn_module->load_model) {
+ av_log(context, AV_LOG_ERROR, "load_model for network was not specified\n");
+ return AVERROR(EIO);
+ }
+ sr_context->model = (sr_context->dnn_module->load_model)(sr_context->model_filename);
if (!sr_context->model){
av_log(context, AV_LOG_ERROR, "could not load DNN model\n");
return AVERROR(EIO);