diff options
author | Sasi Inguva <isasi-at-google.com@ffmpeg.org> | 2017-10-06 19:31:13 +0300 |
---|---|---|
committer | Nicolas George <george@nsup.org> | 2017-10-07 12:17:23 +0300 |
commit | 123f6dc6b56392cdc8ec648da52c64c94ea0ff0c (patch) | |
tree | f547502d3d72e9c96c0f39b346c6c182bc491598 /libavfilter/avfilter.c | |
parent | a20f64bee235042f6e35c8e7ae65ccfddbf7343b (diff) |
lavfi/avfilter.c: Correct guess_status_pts to account for differing link timebases.
Signed-off-by: Sasi Inguva <isasi@google.com>
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 58917ed445..f0f849b326 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -427,19 +427,19 @@ int ff_request_frame(AVFilterLink *link) return 0; } -static int64_t guess_status_pts(AVFilterContext *ctx, int status) +static int64_t guess_status_pts(AVFilterContext *ctx, int status, AVRational link_time_base) { unsigned i; int64_t r = INT64_MAX; for (i = 0; i < ctx->nb_inputs; i++) if (ctx->inputs[i]->status_out == status) - r = FFMIN(r, ctx->inputs[i]->current_pts); + r = FFMIN(r, av_rescale_q(ctx->inputs[i]->current_pts, ctx->inputs[i]->time_base, link_time_base)); if (r < INT64_MAX) return r; av_log(ctx, AV_LOG_WARNING, "EOF timestamp not reliable\n"); for (i = 0; i < ctx->nb_inputs; i++) - r = FFMIN(r, ctx->inputs[i]->status_in_pts); + r = FFMIN(r, av_rescale_q(ctx->inputs[i]->status_in_pts, ctx->inputs[i]->time_base, link_time_base)); if (r < INT64_MAX) return r; return AV_NOPTS_VALUE; @@ -458,7 +458,7 @@ static int ff_request_frame_to_filter(AVFilterLink *link) ret = ff_request_frame(link->src->inputs[0]); if (ret < 0) { if (ret != AVERROR(EAGAIN) && ret != link->status_in) - ff_avfilter_link_set_in_status(link, ret, guess_status_pts(link->src, ret)); + ff_avfilter_link_set_in_status(link, ret, guess_status_pts(link->src, ret, link->time_base)); if (ret == AVERROR_EOF) ret = 0; } |