diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-16 20:43:57 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-19 03:13:16 +0100 |
commit | a582705d15409cdffe87d7bbbd1d58aa03bc6f73 (patch) | |
tree | d483f7c2a7dbf912d13ca86435c01752751a9c67 /ffmpeg.c | |
parent | bf8bcd3b2b51c4d3f0a157e80a8c96c8542217b0 (diff) | |
download | ffmpeg-a582705d15409cdffe87d7bbbd1d58aa03bc6f73.tar.gz |
ffmpeg: Favor filter graph based duration over ost->frame_rate in fps code
The fate change adds a last frame with a subtitle not displayed in the previous
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -900,15 +900,12 @@ static void do_video_out(AVFormatContext *s, if (ost->source_index >= 0) ist = input_streams[ost->source_index]; - if(ist && ist->st->start_time != AV_NOPTS_VALUE && ist->st->first_dts != AV_NOPTS_VALUE && ost->frame_rate.num) - duration = 1/(av_q2d(ost->frame_rate) * av_q2d(enc->time_base)); - - // We take the conservative approuch here and take the minimum even though - // this should be correct on its own but a value too small is harmless, one - // too big can lead to errors if (filter->inputs[0]->frame_rate.num > 0 && filter->inputs[0]->frame_rate.den > 0) - duration = FFMIN(duration, 1/(av_q2d(filter->inputs[0]->frame_rate) * av_q2d(enc->time_base))); + duration = 1/(av_q2d(filter->inputs[0]->frame_rate) * av_q2d(enc->time_base)); + + if(ist && ist->st->start_time != AV_NOPTS_VALUE && ist->st->first_dts != AV_NOPTS_VALUE && ost->frame_rate.num) + duration = FFMIN(duration, 1/(av_q2d(ost->frame_rate) * av_q2d(enc->time_base))); if (!ost->filters_script && !ost->filters && |