Opus initialization data should be in native order.

http://developer.android.com/reference/android/media/MediaCodec.html#CSD
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121957004
This commit is contained in:
eguven 2016-05-10 09:55:14 -07:00 committed by Oliver Woodman
parent 58c0ab1779
commit 9ee3030b79
4 changed files with 9 additions and 6 deletions

View File

@ -258,6 +258,9 @@ import java.util.Locale;
"https://storage.googleapis.com/exoplayer-test-media-1/ogg/play.ogg", Util.TYPE_OTHER),
new Sample("Google Glass (WebM Video with Vorbis Audio)",
"http://demos.webmproject.org/exoplayer/glass_vp9_vorbis.webm", Util.TYPE_OTHER),
new Sample("Google Glass DASH - VP9 and Opus",
"http://demos.webmproject.org/dash/201410/vp9_glass/manifest_vp9_opus.mpd",
Util.TYPE_DASH),
new Sample("Big Buck Bunny (FLV Video)",
"http://vod.leasewebcdn.com/bbb.flv?ri=1024&rs=150&start=0", Util.TYPE_OTHER),
};

View File

@ -115,9 +115,9 @@ import java.util.List;
throw new OpusDecoderException("Invalid Codec Delay or Seek Preroll");
}
long codecDelayNs =
ByteBuffer.wrap(initializationData.get(1)).order(ByteOrder.LITTLE_ENDIAN).getLong();
ByteBuffer.wrap(initializationData.get(1)).order(ByteOrder.nativeOrder()).getLong();
long seekPreRollNs =
ByteBuffer.wrap(initializationData.get(2)).order(ByteOrder.LITTLE_ENDIAN).getLong();
ByteBuffer.wrap(initializationData.get(2)).order(ByteOrder.nativeOrder()).getLong();
headerSkipSamples = nsToSamples(codecDelayNs);
headerSeekPreRollSamples = nsToSamples(seekPreRollNs);
} else {

View File

@ -737,9 +737,9 @@ public final class MatroskaExtractorTest extends InstrumentationTestCase {
android.test.MoreAsserts.assertEquals(TEST_OPUS_CODEC_PRIVATE,
format.initializationData.get(0));
assertEquals(TEST_CODEC_DELAY, ByteBuffer.wrap(format.initializationData.get(1))
.order(ByteOrder.LITTLE_ENDIAN).getLong());
.order(ByteOrder.nativeOrder()).getLong());
assertEquals(TEST_SEEK_PRE_ROLL, ByteBuffer.wrap(format.initializationData.get(2))
.order(ByteOrder.LITTLE_ENDIAN).getLong());
.order(ByteOrder.nativeOrder()).getLong());
} else if (MimeTypes.AUDIO_VORBIS.equals(expectedMimeType)) {
assertEquals(2, format.initializationData.size());
assertEquals(TEST_VORBIS_INFO_SIZE, format.initializationData.get(0).length);

View File

@ -1255,9 +1255,9 @@ public final class MatroskaExtractor implements Extractor {
initializationData = new ArrayList<>(3);
initializationData.add(codecPrivate);
initializationData.add(
ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(codecDelayNs).array());
ByteBuffer.allocate(8).order(ByteOrder.nativeOrder()).putLong(codecDelayNs).array());
initializationData.add(
ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(seekPreRollNs).array());
ByteBuffer.allocate(8).order(ByteOrder.nativeOrder()).putLong(seekPreRollNs).array());
break;
case CODEC_ID_AAC:
mimeType = MimeTypes.AUDIO_AAC;