From 69ca534935d60d7b7e8661627633240df0858070 Mon Sep 17 00:00:00 2001 From: olly Date: Fri, 27 Mar 2020 17:15:49 +0000 Subject: [PATCH] Parse opus gain correctly as a signed value Issue: #7046 PiperOrigin-RevId: 303354941 --- RELEASENOTES.md | 2 ++ .../assets/bear-opus-negative-gain.mka | Bin 0 -> 25717 bytes .../assets/{bear-opus.webm => bear-opus.mka} | Bin .../exoplayer2/ext/opus/OpusPlaybackTest.java | 9 ++++++++- .../exoplayer2/ext/opus/OpusDecoder.java | 10 +++++++--- 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 extensions/opus/src/androidTest/assets/bear-opus-negative-gain.mka rename extensions/opus/src/androidTest/assets/{bear-opus.webm => bear-opus.mka} (100%) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 404597fb13d..1bc43e60fcc 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -24,6 +24,8 @@ in spherical playbacks ([#6761](https://github.com/google/ExoPlayer/issues/6761)). * FFmpeg extension: Add support for x86_64. +* Opus extension: Fix parsing of negative gain values + ([#7046](https://github.com/google/ExoPlayer/issues/7046)). ### 2.11.3 (2020-02-19) ### diff --git a/extensions/opus/src/androidTest/assets/bear-opus-negative-gain.mka b/extensions/opus/src/androidTest/assets/bear-opus-negative-gain.mka new file mode 100644 index 0000000000000000000000000000000000000000..3ee21adfd3011dcad531140331b0b6f24b713c13 GIT binary patch literal 25717 zcmdSA^;cWp^F54vvEuGpq_`8jxI4v)Q`|j4ixhWvr??e&*W&I@ahH74*ZcF!^Cvu6 zD_OZ~C1=f@GqY#Uo^y$$HVdGk{(F&&hk~HRA0Y2*5S;i82uVCJ*u&h^PCN{983KYK zPzPH6@26%WSc)0008+)aNcD z`R|tg&wMGS#o8bYaeyN5r-F&Q1vfVu-Px0>Nzm-#@T&KroFz0EdqMt!Zio!u*z>pzP@8^2OZ53>t`qkv4^{f;Vg@b~w zJd%hEmmtHXVE2?fHRpIZ+`1ghb)FABH&W%$jo^4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v8-$eN01Xxtpy)+6XcOz1&>lQL z`nKnNXjk(HqvM1WIw0q^c?t!v=v2axkN7#y?M(v+02t>IYgt%;oB)$+?61#arLZ1= zMC>Q$&B=2ZT2i1QEWHVMQ$3+0^s?aS>Q(?P|G&Rv00Il1U{HWK3oRT{uu@Fs6@R;8 zexh(G^$M(;K%4G?Hkf!Z^;)gpZg3zi9xI^1nLflMl=LTkRnmdN3~AgACF3HM`$s>( z^DF#F+07|dbZXY$nC?0DLBr#h5B6Y2Qu-Zg1=bpC3%_pjb(6-aPsSN${bYZ54GLDw z?Ur0UzptNeG5m9WS!Z7KXtLMvwa<2+*sT$J4cthjuj;aRvGHc!R=aAC^!6 ze=i(#0b*z~^P$ZUWLwO9%+ViGNaZLR%`0f^6@Vxrtjm%q9a^IgW<(Cg%gzhvIE(G$ X3KR-xb2OJk)GE1Q9)-b3(OCZjb{Qt0 literal 0 HcmV?d00001 diff --git a/extensions/opus/src/androidTest/assets/bear-opus.webm b/extensions/opus/src/androidTest/assets/bear-opus.mka similarity index 100% rename from extensions/opus/src/androidTest/assets/bear-opus.webm rename to extensions/opus/src/androidTest/assets/bear-opus.mka diff --git a/extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java b/extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java index b3d5b525d5d..582ca997df7 100644 --- a/extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java +++ b/extensions/opus/src/androidTest/java/com/google/android/exoplayer2/ext/opus/OpusPlaybackTest.java @@ -37,7 +37,9 @@ @RunWith(AndroidJUnit4.class) public class OpusPlaybackTest { - private static final String BEAR_OPUS_URI = "asset:///bear-opus.webm"; + private static final String BEAR_OPUS_URI = "asset:///bear-opus.mka"; + private static final String BEAR_OPUS_NEGATIVE_GAIN_URI = + "asset:///bear-opus-negative-gain.mka"; @Before public void setUp() { @@ -51,6 +53,11 @@ public void testBasicPlayback() throws Exception { playUri(BEAR_OPUS_URI); } + @Test + public void basicPlaybackNegativeGain() throws Exception { + playUri(BEAR_OPUS_NEGATIVE_GAIN_URI); + } + private void playUri(String uri) throws Exception { TestPlaybackRunnable testPlaybackRunnable = new TestPlaybackRunnable(Uri.parse(uri), ApplicationProvider.getApplicationContext()); diff --git a/extensions/opus/src/main/java/com/google/android/exoplayer2/ext/opus/OpusDecoder.java b/extensions/opus/src/main/java/com/google/android/exoplayer2/ext/opus/OpusDecoder.java index f0e993e3b98..5b880cbb71c 100644 --- a/extensions/opus/src/main/java/com/google/android/exoplayer2/ext/opus/OpusDecoder.java +++ b/extensions/opus/src/main/java/com/google/android/exoplayer2/ext/opus/OpusDecoder.java @@ -90,8 +90,8 @@ public OpusDecoder( if (channelCount > 8) { throw new OpusDecoderException("Invalid channel count: " + channelCount); } - int preskip = readLittleEndian16(headerBytes, 10); - int gain = readLittleEndian16(headerBytes, 16); + int preskip = readUnsignedLittleEndian16(headerBytes, 10); + int gain = readSignedLittleEndian16(headerBytes, 16); byte[] streamMap = new byte[8]; int numStreams; @@ -228,12 +228,16 @@ private static int nsToSamples(long ns) { return (int) (ns * SAMPLE_RATE / 1000000000); } - private static int readLittleEndian16(byte[] input, int offset) { + private static int readUnsignedLittleEndian16(byte[] input, int offset) { int value = input[offset] & 0xFF; value |= (input[offset + 1] & 0xFF) << 8; return value; } + private static int readSignedLittleEndian16(byte[] input, int offset) { + return (short) readUnsignedLittleEndian16(input, offset); + } + private native long opusInit(int sampleRate, int channelCount, int numStreams, int numCoupled, int gain, byte[] streamMap); private native int opusDecode(long decoder, long timeUs, ByteBuffer inputBuffer, int inputSize,