[FFmpeg-devel] [PATCH] avfilter/avf_concat: fix EOF timestamp

Nicolas George george at nsup.org
Tue Jul 27 20:58:25 EEST 2021


Paul B Mahol (12021-07-27):
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavfilter/avf_concat.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/avf_concat.c b/libavfilter/avf_concat.c
> index cb46f52a04..9bbe896444 100644
> --- a/libavfilter/avf_concat.c
> +++ b/libavfilter/avf_concat.c
> @@ -397,12 +397,18 @@ static int activate(AVFilterContext *ctx)
>      /* Forward status change */
>      if (cat->cur_idx < ctx->nb_inputs) {
>          for (i = 0; i < ctx->nb_outputs; i++) {
> -            ret = ff_inlink_acknowledge_status(ctx->inputs[cat->cur_idx + i], &status, &pts);
> +            AVFilterLink *inlink = ctx->inputs[cat->cur_idx + i];
> +
> +            ret = ff_inlink_acknowledge_status(inlink, &status, &pts);
>              /* TODO use pts */
>              if (ret > 0) {
>                  close_input(ctx, cat->cur_idx + i);
>                  if (cat->cur_idx + ctx->nb_outputs >= ctx->nb_inputs) {
> -                    ff_outlink_set_status(ctx->outputs[i], status, pts);

> +                    int64_t eof_pts;
> +
> +                    eof_pts = cat->delta_ts;

You could merge these two lines.

> +                    eof_pts += av_rescale_q(pts, inlink->time_base, ctx->outputs[i]->time_base);
> +                    ff_outlink_set_status(ctx->outputs[i], status, eof_pts);
>                  }
>                  if (!cat->nb_in_active) {
>                      ret = flush_segment(ctx);

LGTM.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210727/bfb65b51/attachment.sig>


More information about the ffmpeg-devel mailing list