Commit a4a248da by sheenachhabra Committed by Tofunmi Adigun-Hameed

Ignore ByteBuffer position when writing samples in Mp4Muxer

PiperOrigin-RevId: 537814319
(cherry picked from commit 68939399b4bb6f6b72376d3f8cf0441c1285e230)
parent a9bc111d
...@@ -270,7 +270,7 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -270,7 +270,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
// Calculate the additional space required. // Calculate the additional space required.
long bytesNeededInMdat = 0L; long bytesNeededInMdat = 0L;
for (Pair<BufferInfo, ByteBuffer> sample : track.pendingSamples) { for (Pair<BufferInfo, ByteBuffer> sample : track.pendingSamples) {
bytesNeededInMdat += sample.second.remaining(); bytesNeededInMdat += sample.second.limit();
} }
// If the required number of bytes doesn't fit in the gap between the actual data and the moov // If the required number of bytes doesn't fit in the gap between the actual data and the moov
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment