summaryrefslogtreecommitdiff
path: root/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-06-27 18:59:23 +0200
committerwm4 <nfxjfg@googlemail.com>2017-03-03 08:45:43 +0100
commitcb884f8d7e3b55cddf8a4568bddb1e5f5f86b811 (patch)
tree1394acc28b5ed84e4fcead1d904ba06e16522f50 /ffmpeg_filter.c
parent97614a68e474062b46f6fae92bf34976f3436c6a (diff)
downloadffmpeg-cb884f8d7e3b55cddf8a4568bddb1e5f5f86b811.tar.gz
ffmpeg: move flushing the queued frames to configure_filtergraph()
This is a more appropriate place for it, and will also be useful in the following commit. This merges Libav commit d2e56cf. It was previously skipped. Signed-off-by: wm4 <nfxjfg@googlemail.com>
Diffstat (limited to 'ffmpeg_filter.c')
-rw-r--r--ffmpeg_filter.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index f21a8c85f8..4d9a4e2eb8 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -1117,6 +1117,17 @@ int configure_filtergraph(FilterGraph *fg)
ost->enc_ctx->frame_size);
}
+ for (i = 0; i < fg->nb_inputs; i++) {
+ while (av_fifo_size(fg->inputs[i]->frame_queue)) {
+ AVFrame *tmp;
+ av_fifo_generic_read(fg->inputs[i]->frame_queue, &tmp, sizeof(tmp), NULL);
+ ret = av_buffersrc_add_frame(fg->inputs[i]->filter, tmp);
+ av_frame_free(&tmp);
+ if (ret < 0)
+ return ret;
+ }
+ }
+
return 0;
}