--- fftools/ffmpeg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index e7384f052a..6ec28f3019 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -766,6 +766,7 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost, { double float_pts = AV_NOPTS_VALUE; // this is identical to frame.pts but with higher precision AVCodecContext *enc = ost->enc_ctx; + AVRational filter_tb = (AVRational){ -1, -1 }; if (!frame || frame->pts == AV_NOPTS_VALUE || !enc || !ost->filter || !ost->filter->graph->graph) goto early_exit; @@ -774,9 +775,9 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost, AVFilterContext *filter = ost->filter->filter; int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time; - AVRational filter_tb = av_buffersink_get_time_base(filter); AVRational tb = enc->time_base; int extra_bits = av_clip(29 - av_log2(tb.den), 0, 16); + filter_tb = av_buffersink_get_time_base(filter); tb.den <<= extra_bits; float_pts = @@ -798,8 +799,8 @@ early_exit: frame ? av_ts2str(frame->pts) : "NULL", frame ? av_ts2timestr(frame->pts, &enc->time_base) : "NULL", float_pts, - enc ? enc->time_base.num : -1, - enc ? enc->time_base.den : -1); + filter_tb.num, + filter_tb.den); } return float_pts; -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".