Created
November 12, 2018 09:27
-
-
Save ryanmarin/86808a7ea2eccd8117f7855dfdf412e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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