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

Commit d58aa6e4 authored by Gopalakrishnan Nallasamy's avatar Gopalakrishnan Nallasamy
Browse files

MediaMuxer:allow negative presentation timestamps

Observed a few audio files starting with negative timestamps, inorder
for those files to be muxed as is removing the check that was erroring when PTS<0.

Bug:142580952

Test: 1) atest android.media.cts.MediaMuxerTest
      2) atest CtsMediaTestCases -- \
         --module-arg CtsMediaTestCases:size:small

Change-Id: I693f1c0046574c14bf6b5e656c40ed6b73bd0f0e
parent a2cfd6c1
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -677,10 +677,9 @@ final public class MediaMuxer {
            throw new IllegalArgumentException("bufferInfo must not be null");
        }
        if (bufferInfo.size < 0 || bufferInfo.offset < 0
                || (bufferInfo.offset + bufferInfo.size) > byteBuf.capacity()
                || bufferInfo.presentationTimeUs < 0) {
                || (bufferInfo.offset + bufferInfo.size) > byteBuf.capacity()) {
            throw new IllegalArgumentException("bufferInfo must specify a" +
                    " valid buffer offset, size and presentation time");
                    " valid buffer offset and size");
        }

        if (mNativeObject == 0) {