History

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()

Jun Zhao committed 7 years ago

Commit 0b7bfa81 parent 5c1fbc41 file · +6 −7Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_sr.c+6−7
@@ -72,17 +72,16 @@ static av_cold int init(AVFilterContext *context) · 71 unmodified lines
7272 av_log(context, AV_LOG_ERROR, "could not create DNN module for requested backend\n");
7373 return AVERROR(ENOMEM);
7474 }
75+
7576 if (!sr_context->model_filename){
7677 av_log(context, AV_LOG_ERROR, "model file for network was not specified\n");
7778 return AVERROR(EIO);
78− } else {
79− if (!sr_context->dnn_module->load_model) {
80− av_log(context, AV_LOG_ERROR, "load_model for network was not specified\n");
81− return AVERROR(EIO);
82− } else {
83− sr_context->model = (sr_context->dnn_module->load_model)(sr_context->model_filename);
84− }
8579 }
80+ if (!sr_context->dnn_module->load_model) {
81+ av_log(context, AV_LOG_ERROR, "load_model for network was not specified\n");
82+ return AVERROR(EIO);
83+ }
84+ sr_context->model = (sr_context->dnn_module->load_model)(sr_context->model_filename);
8685 if (!sr_context->model){
8786 av_log(context, AV_LOG_ERROR, "could not load DNN model\n");
8887 return AVERROR(EIO);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t