mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
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>
This commit is contained in:
parent
0d27e6f86e
commit
9dc5cb34ae
1 changed files with 3 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue