Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-02-24 22:44:46 +0300
committerPaul B Mahol <onemda@gmail.com>2022-02-24 23:28:23 +0300
commit6f04b43c221c1bf825b18f7e2dcc599476ae7b94 (patch)
treef994fac8ff4058341ac34f272b09e4e147c63d4a /libavfilter/vf_tpad.c
parent3715f2f8643695940582ce040b7a052cccfb9db2 (diff)
avfilter/vf_tpad: handle case when no frame was ever received
Diffstat (limited to 'libavfilter/vf_tpad.c')
-rw-r--r--libavfilter/vf_tpad.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c
index 120dbcb4d3..c870478158 100644
--- a/libavfilter/vf_tpad.c
+++ b/libavfilter/vf_tpad.c
@@ -79,6 +79,18 @@ static int activate(AVFilterContext *ctx)
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+ if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
+ if (status == AVERROR_EOF) {
+ pts = av_rescale_q(pts, inlink->time_base, outlink->time_base);
+ if (!s->pad_stop && !s->pad_start) {
+ ff_outlink_set_status(outlink, status, pts);
+ return 0;
+ }
+ s->eof = 1;
+ s->pts += pts;
+ }
+ }
+
if (s->start_mode == 0 && s->pad_start > 0 && ff_outlink_frame_wanted(outlink)) {
frame = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!frame)
@@ -93,7 +105,10 @@ static int activate(AVFilterContext *ctx)
}
if (s->start_mode == 1 && s->pad_start > 0) {
- if (!s->cache_start && ff_inlink_queued_frames(inlink)) {
+ if (s->eof) {
+ ff_outlink_set_status(outlink, AVERROR_EOF, 0);
+ return 0;
+ } else if (!s->cache_start && ff_inlink_queued_frames(inlink)) {
s->cache_start = ff_inlink_peek_frame(inlink, 0);
} else if (!s->cache_start) {
FF_FILTER_FORWARD_WANTED(outlink, inlink);
@@ -123,18 +138,6 @@ static int activate(AVFilterContext *ctx)
}
}
- if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
- if (status == AVERROR_EOF) {
- pts = av_rescale_q(pts, inlink->time_base, outlink->time_base);
- if (!s->pad_stop) {
- ff_outlink_set_status(outlink, status, pts);
- return 0;
- }
- s->eof = 1;
- s->pts += pts;
- }
- }
-
if (s->eof) {
if (!s->pad_stop) {
ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);