Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 616c2cf1 authored by Marco Nelissen's avatar Marco Nelissen Committed by Android Git Automerger
Browse files

am 90892d1b: Merge "Fix SIGABRT when playing mp4 file"

* commit '90892d1b':
  Fix SIGABRT when playing mp4 file
parents 97f6618f 90892d1b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -963,6 +963,12 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
                    mLastTrack->meta->setInt32(kKeyEncoderDelay, delay);

                    int64_t paddingus = duration - (segment_duration + media_time);
                    if (paddingus < 0) {
                        // track duration from media header (which is what kKeyDuration is) might
                        // be slightly shorter than the segment duration, which would make the
                        // padding negative. Clamp to zero.
                        paddingus = 0;
                    }
                    int64_t paddingsamples = (paddingus * samplerate + 500000) / 1000000;
                    mLastTrack->meta->setInt32(kKeyEncoderPadding, paddingsamples);
                }