fftools/ffmpeg: remove a useless inner block
adjust_frame_pts_to_encoder_tb() is so small that this serves no useful purpose.
This commit is contained in:
@@ -676,17 +676,18 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost,
|
|||||||
AVFrame *frame)
|
AVFrame *frame)
|
||||||
{
|
{
|
||||||
double float_pts = AV_NOPTS_VALUE; // this is identical to frame.pts but with higher precision
|
double float_pts = AV_NOPTS_VALUE; // this is identical to frame.pts but with higher precision
|
||||||
AVCodecContext *enc = ost->enc_ctx;
|
const int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ?
|
||||||
AVRational filter_tb = (AVRational){ -1, -1 };
|
0 : of->start_time;
|
||||||
|
|
||||||
|
AVCodecContext *const enc = ost->enc_ctx;
|
||||||
|
|
||||||
|
AVRational tb = enc->time_base;
|
||||||
|
AVRational filter_tb = frame->time_base;
|
||||||
|
const int extra_bits = av_clip(29 - av_log2(tb.den), 0, 16);
|
||||||
|
|
||||||
if (frame->pts == AV_NOPTS_VALUE)
|
if (frame->pts == AV_NOPTS_VALUE)
|
||||||
goto early_exit;
|
goto early_exit;
|
||||||
|
|
||||||
{
|
|
||||||
int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time;
|
|
||||||
AVRational tb = enc->time_base;
|
|
||||||
int extra_bits = av_clip(29 - av_log2(tb.den), 0, 16);
|
|
||||||
filter_tb = frame->time_base;
|
|
||||||
|
|
||||||
tb.den <<= extra_bits;
|
tb.den <<= extra_bits;
|
||||||
float_pts =
|
float_pts =
|
||||||
av_rescale_q(frame->pts, filter_tb, tb) -
|
av_rescale_q(frame->pts, filter_tb, tb) -
|
||||||
@@ -699,7 +700,6 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost,
|
|||||||
av_rescale_q(frame->pts, filter_tb, enc->time_base) -
|
av_rescale_q(frame->pts, filter_tb, enc->time_base) -
|
||||||
av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base);
|
av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base);
|
||||||
frame->time_base = enc->time_base;
|
frame->time_base = enc->time_base;
|
||||||
}
|
|
||||||
|
|
||||||
early_exit:
|
early_exit:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user