In MP4TrackDemuxer constructor, getting the track info and indices could potentially fail, triggering crashing assertions. The fallible work is now done before calling the constructor, and if it fails a nullptr is returned, which is correctly handled in MediaFormatReader. Also reordered some MP4TrackDemuxer members for more natural construction.
A typical non-fragmented mp4 would have the ftyp atom located at the beginning of the mp4 and the moov at the end. We would to calculate the location of the metadata by spanning the byte range of the two atoms. As such, we would typically allocate an amount of memory equivalent to the size of the mp4.
Instead we now reconstruct the metadata to only have the ftyp and moov atoms contiguously.