summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2021-08-19 16:02:47 +1000
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-08-23 04:17:36 +0000
commit9dc5cb34aeff9b8d6e468ec4be957a647d2e87c0 (patch)
tree072b1b56d312155975c035b7af30117d72f90979
parent0d27e6f86ef9719b816a808709d9accddf11cc9f (diff)
downloadgstreamer-plugins-good-9dc5cb34aeff9b8d6e468ec4be957a647d2e87c0.tar.gz
isomp4/mux: don't overwrite with a bigger moov when fragmenting
When outputting fragmented mp4, with a seekable downstream, we rewrite the moov to maybe add a duration to the mvex. If we start by not writing the initial moov->mvex->mhed duration and then overwrite with a moov containing mhed atom, the moov's will have different sizes and could overwrite subsequent data and result in an unplayable file. e.g. The initial moov would be of size 842 and the final moov would have a size of 862. Fix by always pushing out the mhed duration in the moov when fragmenting. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/898 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1060>
-rw-r--r--gst/isomp4/atoms.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gst/isomp4/atoms.c b/gst/isomp4/atoms.c
index cc191edb3..290d1fdf6 100644
--- a/gst/isomp4/atoms.c
+++ b/gst/isomp4/atoms.c
@@ -2970,11 +2970,9 @@ atom_mvex_copy_data (AtomMVEX * mvex, guint8 ** buffer, guint64 * size,
return 0;
}
- if (mvex->mehd.fragment_duration > 0) {
- /* only write mehd if we have anything extra to add */
- if (!atom_mehd_copy_data (&mvex->mehd, buffer, size, offset)) {
- return 0;
- }
+ /* only write mehd if we have anything extra to add */
+ if (!atom_mehd_copy_data (&mvex->mehd, buffer, size, offset)) {
+ return 0;
}
walker = g_list_first (mvex->trexs);