Skip to content

Commit

Permalink
avfilter/f_loop: fix looping for aloop
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpl committed May 14, 2023
1 parent 7a63add commit 8041d00
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libavfilter/f_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ static int aactivate(AVFilterContext *ctx)
update_time(ctx, inlink->time_base);

if (!s->eof && (s->nb_samples < s->size || !s->loop || !s->size)) {
ret = ff_inlink_consume_frame(inlink, &frame);
const int in_nb_samples = FFMIN(1024, s->size - s->nb_samples);
if (in_nb_samples == 0)
ret = ff_inlink_consume_frame(inlink, &frame);
else
ret = ff_inlink_consume_samples(inlink, in_nb_samples, in_nb_samples, &frame);
if (ret < 0)
return ret;
if (ret > 0)
Expand Down

0 comments on commit 8041d00

Please sign in to comment.