Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avfilter/buffersrc: stop passing AV_NOPTS_VALUE on EOF
@ 2023-06-15 15:17 Paul B Mahol
  2023-06-15 15:40 ` Niklas Haas
  2023-06-15 20:27 ` Paul B Mahol
  0 siblings, 2 replies; 3+ messages in thread
From: Paul B Mahol @ 2023-06-15 15:17 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 10 bytes --]

Attached.

[-- Attachment #2: 0001-avfilter-buffersrc-stop-passing-AV_NOPTS_VALUE-on-EO.patch --]
[-- Type: text/x-patch, Size: 1173 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-15 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 15:17 [FFmpeg-devel] [PATCH] avfilter/buffersrc: stop passing AV_NOPTS_VALUE on EOF Paul B Mahol
2023-06-15 15:40 ` Niklas Haas
2023-06-15 20:27 ` Paul B Mahol

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