Commit 55e0b041 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_mix: output same number of frames from input for tmix

parent 1148e5f1
...@@ -415,8 +415,12 @@ static int tmix_filter_frame(AVFilterLink *inlink, AVFrame *in) ...@@ -415,8 +415,12 @@ static int tmix_filter_frame(AVFilterLink *inlink, AVFrame *in)
if (s->nb_frames < s->nb_inputs) { if (s->nb_frames < s->nb_inputs) {
s->frames[s->nb_frames] = in; s->frames[s->nb_frames] = in;
s->nb_frames++; s->nb_frames++;
if (s->nb_frames < s->nb_inputs) while (s->nb_frames < s->nb_inputs) {
return 0; s->frames[s->nb_frames] = av_frame_clone(s->frames[s->nb_frames - 1]);
if (!s->frames[s->nb_frames])
return AVERROR(ENOMEM);
s->nb_frames++;
}
} else { } else {
av_frame_free(&s->frames[0]); av_frame_free(&s->frames[0]);
memmove(&s->frames[0], &s->frames[1], sizeof(*s->frames) * (s->nb_inputs - 1)); memmove(&s->frames[0], &s->frames[1], sizeof(*s->frames) * (s->nb_inputs - 1));
...@@ -433,7 +437,7 @@ static int tmix_filter_frame(AVFilterLink *inlink, AVFrame *in) ...@@ -433,7 +437,7 @@ static int tmix_filter_frame(AVFilterLink *inlink, AVFrame *in)
out = ff_get_video_buffer(outlink, outlink->w, outlink->h); out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) if (!out)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
out->pts = s->frames[0]->pts; out->pts = s->frames[s->nb_frames - 1]->pts;
td.out = out; td.out = out;
td.in = s->frames; td.in = s->frames;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment