| static int activate(AVFilterContext *ctx) { | |
| FeedContext *feed = ctx->priv; | |
| int ret, status, nb_samples = 0; | |
| if (!feed->abuf && !feed->vbuf && feed->file.open == 1) { | |
| // if a file is open use it instead of the inlinks | |
| } | |
| else if (!feed->abuf && !feed->vbuf && !feed->file.open) { | |
| if (ff_outlink_frame_wanted(feed->ov)) { | |
| ret = ff_inlink_consume_frame(feed->iv, &feed->vbuf); | |
| if (ret < 0) | |
| return ret; | |
| else if (ret==0) { | |
| ff_inlink_request_frame(feed->iv); | |
| } | |
| } | |
| if (ff_outlink_frame_wanted(feed->oa)) { | |
| nb_samples = ff_inlink_queued_samples(feed->ia); | |
| if (nb_samples > 0 && ff_inlink_check_available_samples(feed->ia, nb_samples) > 0) { | |
| ret = ff_inlink_consume_samples(feed->ia, nb_samples, nb_samples, &feed->abuf); | |
| if (ret < 0) | |
| return ret; | |
| } | |
| else { | |
| ff_inlink_request_frame(feed->ia); | |
| } | |
| } | |
| } | |
| if (feed->vbuf) { | |
| ret = ff_filter_frame(feed->ov,feed->vbuf); | |
| feed->vbuf = NULL; | |
| return ret; | |
| } | |
| if (feed->abuf) { | |
| ret = ff_filter_frame(feed->oa,feed->abuf); | |
| feed->abuf = NULL; | |
| return ret; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment