Browse Source

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>
tags/n4.2
Jun Zhao 6 years ago
parent
commit
0b7bfa8ad7
1 changed files with 6 additions and 7 deletions
  1. +6
    -7
      libavfilter/vf_sr.c

+ 6
- 7
libavfilter/vf_sr.c View File

@@ -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);


Loading…
Cancel
Save