qtmux: use trun with multiple entries in more cases
authorMatthew Waters <matthew@centricular.com>
Thu, 17 Nov 2022 09:59:35 +0000 (20:59 +1100)
committerMatthew Waters <matthew@centricular.com>
Thu, 17 Nov 2022 10:04:57 +0000 (21:04 +1100)
commit8e355d23a1b59ef35bca9f26d35ee9ead765bd14
tree477b60c6f15b7050c11fcab515be5f412b70f2f5
parent416446b25cc8a1059d338ce7434924cccf953555
qtmux: use trun with multiple entries in more cases

The only case where we definitely need to write a new trun is when the
data_offset value does not match the end of the list of entries.
Needing multiple trun atoms is required when interleaving multiple
streams together.

All other cases can be covered by adding more entries to the existing
trun atom.

Fixes playback of fragemented mp4 in ffplay and chrome.

Using e.g. mp4mux fragment-duration=1000 fragment-mode=dash-or-mss
and
mp4mux fragment-duration=1000 fragment-mode=first-moov-then-finalise

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3426>
subprojects/gst-plugins-good/gst/isomp4/atoms.c