No functional change.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -302,14 +302,26 @@ static int flush_frame(AVFilterLink *outlink, int final, AVFrame **outsamplesref · 301 unmodified lines | |||
| 302 | return 0; | 302 | return 0; |
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | static int request_frame(AVFilterLink *outlink) | 305 | static int activate(AVFilterContext *ctx) |
| 306 | { | 306 | { |
| 307 | AVFilterContext *ctx = outlink->src; | ||
| 308 | AVFilterLink *inlink = ctx->inputs[0]; | 307 | AVFilterLink *inlink = ctx->inputs[0]; |
| 308 | AVFilterLink *outlink = ctx->outputs[0]; | ||
| 309 | AResampleContext *aresample = ctx->priv; | 309 | AResampleContext *aresample = ctx->priv; |
| 310 | int ret = 0, status; | 310 | int ret = 0, status; |
| 311 | int64_t pts; | 311 | int64_t pts; |
| 312 | 312 | ||
| 313 | FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); | ||
| 314 | |||
| 315 | if (!aresample->eof && ff_inlink_queued_frames(inlink)) { | ||
| 316 | AVFrame *frame = NULL; | ||
| 317 | |||
| 318 | ret = ff_inlink_consume_frame(inlink, &frame); | ||
| 319 | if (ret < 0) | ||
| 320 | return ret; | ||
| 321 | if (ret > 0) | ||
| 322 | return filter_frame(inlink, frame); | ||
| 323 | } | ||
| 324 | |||
| 313 | // First try to get data from the internal buffers | 325 | // First try to get data from the internal buffers |
| 314 | if (aresample->more_data) { | 326 | if (aresample->more_data) { |
| 315 | AVFrame *outsamplesref; | 327 | AVFrame *outsamplesref; |
| @@ -346,28 +358,6 @@ static int request_frame(AVFilterLink *outlink) · 30 unmodified lines | |||
| 346 | return 0; | 358 | return 0; |
| 347 | } | 359 | } |
| 348 | 360 | ||
| 349 | static int activate(AVFilterContext *ctx) | ||
| 350 | { | ||
| 351 | AResampleContext *aresample = ctx->priv; | ||
| 352 | AVFilterLink *inlink = ctx->inputs[0]; | ||
| 353 | AVFilterLink *outlink = ctx->outputs[0]; | ||
| 354 | |||
| 355 | FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); | ||
| 356 | |||
| 357 | if (!aresample->eof && ff_inlink_queued_frames(inlink)) { | ||
| 358 | AVFrame *frame = NULL; | ||
| 359 | int ret; | ||
| 360 | |||
| 361 | ret = ff_inlink_consume_frame(inlink, &frame); | ||
| 362 | if (ret < 0) | ||
| 363 | return ret; | ||
| 364 | if (ret > 0) | ||
| 365 | return filter_frame(inlink, frame); | ||
| 366 | } | ||
| 367 | |||
| 368 | return request_frame(outlink); | ||
| 369 | } | ||
| 370 | |||
| 371 | static const AVClass *resample_child_class_iterate(void **iter) | 361 | static const AVClass *resample_child_class_iterate(void **iter) |
| 372 | { | 362 | { |
| 373 | const AVClass *c = *iter ? NULL : swr_get_class(); | 363 | const AVClass *c = *iter ? NULL : swr_get_class(); |