Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Niklas Haas <ffmpeg@haasn.xyz>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avfilter/buffersrc: stop passing AV_NOPTS_VALUE on EOF
Date: Thu, 15 Jun 2023 17:40:31 +0200
Message-ID: <20230615174031.GB18952@haasn.xyz> (raw)
In-Reply-To: <CAPYw7P5UTmRMJdjx3WXcvtu_6hy7Os4opi4NXB34TvBfmHPGOQ@mail.gmail.com>

On Thu, 15 Jun 2023 17:17:41 +0200 Paul B Mahol <onemda@gmail.com> wrote:
> Attached.
> From 88fbb2fbfd2bb7cb3474d54cb197ee42b1404532 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> Date: Thu, 15 Jun 2023 17:15:44 +0200
> Subject: [PATCH] avfilter/buffersrc: stop passing AV_NOPTS_VALUE on EOF
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavfilter/buffersrc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
> index 612541b803..ea50713701 100644
> --- a/libavfilter/buffersrc.c
> +++ b/libavfilter/buffersrc.c
> @@ -61,6 +61,7 @@ typedef struct BufferSourceContext {
>      AVChannelLayout ch_layout;
>  
>      int eof;
> +    int64_t last_pts;
>  } BufferSourceContext;
>  
>  #define CHECK_VIDEO_PARAM_CHANGE(s, c, width, height, format, pts)\
> @@ -191,10 +192,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
>      s->nb_failed_requests = 0;
>  
>      if (!frame)
> -        return av_buffersrc_close(ctx, AV_NOPTS_VALUE, flags);
> +        return av_buffersrc_close(ctx, s->last_pts, flags);
>      if (s->eof)
>          return AVERROR(EINVAL);
>  
> +    s->last_pts = frame->pts + frame->duration;
> +
>      refcounted = !!frame->buf[0];
>  
>      if (!(flags & AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT)) {
> -- 
> 2.39.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

Confirming that this fixes a bug I was encountering.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2023-06-15 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 15:17 Paul B Mahol
2023-06-15 15:40 ` Niklas Haas [this message]
2023-06-15 20:27 ` Paul B Mahol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230615174031.GB18952@haasn.xyz \
    --to=ffmpeg@haasn.xyz \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git