aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-06-15 17:15:44 +0200
committerPaul B Mahol <onemda@gmail.com>2023-06-16 11:46:09 +0200
commit12a073f72cf146d16c7987cf8782519b69be5f56 (patch)
tree57daf8e30cff9336f32708935f998aa249de9f09 /libavfilter
parent4abf42ab96a8176b08d03791e3b155c7612f8145 (diff)
downloadffmpeg-12a073f72cf146d16c7987cf8782519b69be5f56.tar.gz
avfilter/buffersrc: stop passing AV_NOPTS_VALUE on EOF
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/buffersrc.c5
1 files changed, 4 insertions, 1 deletions
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)) {