avfilter/buffersrc: stop passing AV_NOPTS_VALUE on EOF

pull/389/head
Paul B Mahol 2 years ago
parent 4abf42ab96
commit 12a073f72c
  1. 5
      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)) {

Loading…
Cancel
Save