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
72 av_log(context, AV_LOG_ERROR, "could not create DNN module for requested backend\n");72 av_log(context, AV_LOG_ERROR, "could not create DNN module for requested backend\n");
73 return AVERROR(ENOMEM);73 return AVERROR(ENOMEM);
74 }74 }
75
75 if (!sr_context->model_filename){76 if (!sr_context->model_filename){
76 av_log(context, AV_LOG_ERROR, "model file for network was not specified\n");77 av_log(context, AV_LOG_ERROR, "model file for network was not specified\n");
77 return AVERROR(EIO);78 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 }
85 }79 }
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);
86 if (!sr_context->model){85 if (!sr_context->model){
87 av_log(context, AV_LOG_ERROR, "could not load DNN model\n");86 av_log(context, AV_LOG_ERROR, "could not load DNN model\n");
88 return AVERROR(EIO);87 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