mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-12-13 06:16:06 +00:00
avformat/matroskaenc: Avoid floats in default duration calculation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8aa9853093
commit
cf86fd0069
@ -926,10 +926,10 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
|
||||
put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_VIDEO);
|
||||
|
||||
if( st->avg_frame_rate.num > 0 && st->avg_frame_rate.den > 0
|
||||
&& 1.0/av_q2d(st->avg_frame_rate) > av_q2d(codec->time_base))
|
||||
put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, 1E9 / av_q2d(st->avg_frame_rate));
|
||||
&& av_cmp_q(av_inv_q(st->avg_frame_rate), codec->time_base) > 0)
|
||||
put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, 1000000000LL * st->avg_frame_rate.den / st->avg_frame_rate.num);
|
||||
else
|
||||
put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, av_q2d(codec->time_base)*1E9);
|
||||
put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, 1000000000LL * codec->time_base.num / codec->time_base.den);
|
||||
|
||||
if (!native_id &&
|
||||
ff_codec_get_tag(ff_codec_movvideo_tags, codec->codec_id) &&
|
||||
|
Loading…
Reference in New Issue
Block a user