Commit af4028f3 by xufuji456

Fix MOV with pcm_alaw/pcm_mulaw which is fixedSampleSize

parent a3a57607
......@@ -386,7 +386,9 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
// Fixed sample size raw audio may need to be rechunked.
boolean isFixedSampleSizeRawAudio =
sampleSizeBox.isFixedSampleSize()
&& MimeTypes.AUDIO_RAW.equals(track.format.sampleMimeType)
&& (MimeTypes.AUDIO_RAW.equals(track.format.sampleMimeType)
|| MimeTypes.AUDIO_MLAW.equals(track.format.sampleMimeType)
|| MimeTypes.AUDIO_ALAW.equals(track.format.sampleMimeType))
&& remainingTimestampDeltaChanges == 0
&& remainingTimestampOffsetChanges == 0
&& remainingSynchronizationSamples == 0;
......@@ -406,8 +408,14 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
chunkOffsetsBytes[chunkIterator.index] = chunkIterator.offset;
chunkSampleCounts[chunkIterator.index] = chunkIterator.numSamples;
}
int fixedSampleSize =
Util.getPcmFrameSize(track.format.pcmEncoding, track.format.channelCount);
int fixedSampleSize;
if (MimeTypes.AUDIO_MLAW.equals(track.format.sampleMimeType)
|| MimeTypes.AUDIO_ALAW.equals(track.format.sampleMimeType)) {
fixedSampleSize = sampleSizeBox.isFixedSampleSize() ? sampleSizeBox.readNextSampleSize() : 1;
} else {
fixedSampleSize =
Util.getPcmFrameSize(track.format.pcmEncoding, track.format.channelCount);
}
FixedSampleSizeRechunker.Results rechunkedResults =
FixedSampleSizeRechunker.rechunk(
fixedSampleSize, chunkOffsetsBytes, chunkSampleCounts, timestampDeltaInTimeUnits);
......
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