Set language field when creating MediaFormat from a Format

Currently Transformer simply omits the language field from the input
media file when writing data to the output file.

PiperOrigin-RevId: 591287481
This commit is contained in:
sheenachhabra 2023-12-15 10:03:36 -08:00 committed by Copybara-Service
parent 7579693739
commit 1303bfbc7c

View file

@ -123,6 +123,7 @@ import java.nio.ByteBuffer;
} else {
mediaFormat =
MediaFormat.createAudioFormat(sampleMimeType, format.sampleRate, format.channelCount);
MediaFormatUtil.maybeSetString(mediaFormat, MediaFormat.KEY_LANGUAGE, format.language);
}
MediaFormatUtil.setCsdBuffers(mediaFormat, format.initializationData);
int trackIndex;