diff --git a/gst/isomp4/atoms.c b/gst/isomp4/atoms.c index 360e411ce7..1d0735ce70 100644 --- a/gst/isomp4/atoms.c +++ b/gst/isomp4/atoms.c @@ -3281,7 +3281,7 @@ atom_trak_update_duration (AtomTRAK * trak, guint64 moov_timescale) atom_stts_get_total_duration (&trak->mdia.minf.stbl.stts); if (trak->mdia.mdhd.time_info.timescale != 0) { trak->tkhd.duration = - gst_util_uint64_scale (trak->mdia.mdhd.time_info.duration, + gst_util_uint64_scale_round (trak->mdia.mdhd.time_info.duration, moov_timescale, trak->mdia.mdhd.time_info.timescale); } else { trak->tkhd.duration = 0; diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index c5fd2ca203..508379b232 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -3648,9 +3648,11 @@ gst_qt_mux_stop_file (GstQTMux * qtmux) * mvhd should be consistent with empty moov * (but TODO maybe some clients do not handle that well ?) */ qtmux->moov->mvex.mehd.fragment_duration = - gst_util_uint64_scale (qtmux->last_dts, qtmux->timescale, GST_SECOND); - GST_DEBUG_OBJECT (qtmux, "rewriting moov with mvex duration %" - GST_TIME_FORMAT, GST_TIME_ARGS (qtmux->last_dts)); + gst_util_uint64_scale_round (qtmux->last_dts, qtmux->timescale, + GST_SECOND); + GST_DEBUG_OBJECT (qtmux, + "rewriting moov with mvex duration %" GST_TIME_FORMAT, + GST_TIME_ARGS (qtmux->last_dts)); /* seek and rewrite the header */ gst_segment_init (&segment, GST_FORMAT_BYTES); segment.start = qtmux->moov_pos;