move the pad/vpad related operation with more natural coding style.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -1180,6 +1180,10 @@ static av_cold int init(AVFilterContext *ctx) · 1179 unmodified lines | |||
| 1180 | if (!pad.name) | 1180 | if (!pad.name) |
| 1181 | return AVERROR(ENOMEM); | 1181 | return AVERROR(ENOMEM); |
| 1182 | 1182 | ||
| 1183 | ret = ff_insert_outpad(ctx, 0, &pad); | ||
| 1184 | if (ret < 0) | ||
| 1185 | return ret; | ||
| 1186 | |||
| 1183 | if (s->response) { | 1187 | if (s->response) { |
| 1184 | vpad = (AVFilterPad){ | 1188 | vpad = (AVFilterPad){ |
| 1185 | .name = av_strdup("filter_response"), | 1189 | .name = av_strdup("filter_response"), |
| @@ -1188,13 +1192,7 @@ static av_cold int init(AVFilterContext *ctx) · 2 unmodified lines | |||
| 1188 | }; | 1192 | }; |
| 1189 | if (!vpad.name) | 1193 | if (!vpad.name) |
| 1190 | return AVERROR(ENOMEM); | 1194 | return AVERROR(ENOMEM); |
| 1191 | } | ||
| 1192 | 1195 | ||
| 1193 | ret = ff_insert_outpad(ctx, 0, &pad); | ||
| 1194 | if (ret < 0) | ||
| 1195 | return ret; | ||
| 1196 | |||
| 1197 | if (s->response) { | ||
| 1198 | ret = ff_insert_outpad(ctx, 1, &vpad); | 1196 | ret = ff_insert_outpad(ctx, 1, &vpad); |
| 1199 | if (ret < 0) | 1197 | if (ret < 0) |
| 1200 | return ret; | 1198 | return ret; |