mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-21 05:26:23 +00:00
qtmux: Handle time information value > UINT32_MAX
If any duration in timescale is larger than UINT32_MAX, use version 1 atom, otherwise file header will be constructed with truncated values. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6843>
This commit is contained in:
parent
c1b1c849f2
commit
05f9eadcaf
1 changed files with 9 additions and 0 deletions
|
@ -3352,10 +3352,15 @@ atom_trak_update_duration (AtomTRAK * trak, guint64 moov_timescale)
|
|||
{
|
||||
trak->mdia.mdhd.time_info.duration =
|
||||
atom_stts_get_total_duration (&trak->mdia.minf.stbl.stts);
|
||||
if (trak->mdia.mdhd.time_info.duration > G_MAXUINT32)
|
||||
trak->mdia.mdhd.header.version = 1;
|
||||
|
||||
if (trak->mdia.mdhd.time_info.timescale != 0) {
|
||||
trak->tkhd.duration =
|
||||
gst_util_uint64_scale_round (trak->mdia.mdhd.time_info.duration,
|
||||
moov_timescale, trak->mdia.mdhd.time_info.timescale);
|
||||
if (trak->tkhd.duration > G_MAXUINT32)
|
||||
trak->tkhd.header.version = 1;
|
||||
} else {
|
||||
trak->tkhd.duration = 0;
|
||||
}
|
||||
|
@ -3434,6 +3439,10 @@ atom_moov_update_duration (AtomMOOV * moov)
|
|||
}
|
||||
moov->mvhd.time_info.duration = duration;
|
||||
moov->mvex.mehd.fragment_duration = duration;
|
||||
if (duration > G_MAXUINT32) {
|
||||
moov->mvhd.header.version = 1;
|
||||
moov->mvex.mehd.header.version = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue