Commit ae31ab80 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_shuffleframes: unbreak filter

Regression since 736e2e2c.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 8cfe60ef
......@@ -84,14 +84,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
ShuffleFramesContext *s = ctx->priv;
int ret;
int ret = 0;
if (s->in_frames < s->nb_frames) {
s->frames[s->in_frames] = frame;
s->pts[s->in_frames] = frame->pts;
s->in_frames++;
ret = 0;
} else if (s->in_frames == s->nb_frames) {
}
if (s->in_frames == s->nb_frames) {
int n, x;
for (n = 0; n < s->nb_frames; n++) {
......@@ -108,8 +109,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
for (n = 0; n < s->nb_frames; n++)
av_frame_free(&s->frames[n]);
} else
av_assert0(0);
}
return ret;
}
......@@ -118,6 +118,11 @@ static av_cold void uninit(AVFilterContext *ctx)
{
ShuffleFramesContext *s = ctx->priv;
while (s->in_frames > 0) {
s->in_frames--;
av_frame_free(&s->frames[s->in_frames]);
}
av_freep(&s->frames);
av_freep(&s->map);
av_freep(&s->pts);
......
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