-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to play opus files on v2.17.0. Works fine with previous version of EXOPlayer (IllegalStateException) #10038
Comments
The line that's throwing the exception was introduced during the internal code review of PR #9864 and is part of fe7e5b8. It's failing because it's finding a second Opus identification header in the file, which the spec (RFC7845) clearly forbids. The spec requires the ID header to be in the first Ogg packet: In section 3:
In section 5:
When looking at the file in a binary viewer, you can see two So I think this media is invalid - but we can tweak ExoPlayer to be more permissive here and only accept the first ID and comment headers it finds, ignoring all subsequent ones - this more closely matches the behaviour from 2.16.1. I'll make that change. [1] $ hexdump -C seaOfMonsters-09.opus | less
00000000 4f 67 67 53 00 02 00 00 00 00 00 00 00 00 4e 38 |OggS..........N8|
00000010 b8 3f 00 00 00 00 c6 c9 2c 3a 01 13 4f 70 75 73 |.?......,:..Opus|
00000020 48 65 61 64 01 02 38 01 44 ac 00 00 00 00 00 4f |Head..8.D......O|
00000030 67 67 53 00 00 00 00 00 00 00 00 00 00 4e 38 b8 |ggS..........N8.|
00000040 3f 01 00 00 00 f2 19 0d 48 01 e5 4f 70 75 73 54 |?.......H..OpusT|
00000050 61 67 73 1f 00 00 00 6c 69 62 6f 70 75 73 20 31 |ags....libopus 1|
00000060 2e 33 2e 31 2c 20 6c 69 62 6f 70 75 73 65 6e 63 |.3.1, libopusenc|
00000070 20 30 2e 32 2e 31 07 00 00 00 0f 00 00 00 54 49 | 0.2.1........TI|
00000080 54 4c 45 3d 43 68 61 70 74 65 72 20 38 13 00 00 |TLE=Chapter 8...|
00000090 00 41 52 54 49 53 54 3d 52 69 63 6b 20 52 69 6f |.ARTIST=Rick Rio|
000000a0 72 64 61 6e 19 00 00 00 41 4c 42 55 4d 3d 54 68 |rdan....ALBUM=Th|
000000b0 65 20 53 65 61 20 6f 66 20 4d 6f 6e 73 74 65 72 |e Sea of Monster|
000000c0 73 09 00 00 00 44 41 54 45 3d 32 30 30 36 0e 00 |s....DATE=2006..|
000000d0 00 00 54 52 41 43 4b 4e 55 4d 42 45 52 3d 30 39 |..TRACKNUMBER=09|
000000e0 0d 00 00 00 54 52 41 43 4b 54 4f 54 41 4c 3d 32 |....TRACKTOTAL=2|
000000f0 32 3a 00 00 00 44 45 53 43 52 49 50 54 49 4f 4e |2:...DESCRIPTION|
00000100 3d 50 65 72 63 79 20 4a 61 63 6b 73 6f 6e 20 61 |=Percy Jackson a|
00000110 6e 64 20 74 68 65 20 4f 6c 79 6d 70 69 61 6e 73 |nd the Olympians|
00000120 20 53 65 72 69 65 73 2c 20 42 6f 6f 6b 20 32 01 | Series, Book 2.|
00000130 4f 67 67 53 00 00 00 00 00 00 00 00 00 00 4e 38 |OggS..........N8|
00000140 b8 3f 02 00 00 00 9a df f5 cc 01 13 4f 70 75 73 |.?..........Opus|
00000150 48 65 61 64 01 02 38 01 44 ac 00 00 00 00 00 4f |Head..8.D......O|
00000160 67 67 53 00 00 00 00 00 00 00 00 00 00 4e 38 b8 |ggS..........N8.|
00000170 3f 03 00 00 00 f8 84 63 5f 03 ff ff fe 4f 70 75 |?......c_....Opu|
00000180 73 54 61 67 73 1f 00 00 00 6c 69 62 6f 70 75 73 |sTags....libopus|
00000190 20 31 2e 33 2e 31 2c 20 6c 69 62 6f 70 75 73 65 | 1.3.1, libopuse|
000001a0 6e 63 20 30 2e 32 2e 31 02 00 00 00 23 00 00 00 |nc 0.2.1....#...|
000001b0 45 4e 43 4f 44 45 52 3d 6f 70 75 73 65 6e 63 20 |ENCODER=opusenc |
000001c0 66 72 6f 6d 20 6f 70 75 73 2d 74 6f 6f 6c 73 20 |from opus-tools |
000001d0 30 2e 32 15 00 00 00 45 4e 43 4f 44 45 52 5f 4f |0.2....ENCODER_O|
000001e0 50 54 49 4f 4e 53 3d 2d 2d 76 62 72 00 00 00 00 |PTIONS=--vbr....|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000470 00 00 00 00 00 00 00 00 00 4f 67 67 53 00 00 80 |.........OggS...| |
Thanks that would be great!
…On Wed, Mar 9, 2022 at 7:24 AM Ian Baker ***@***.***> wrote:
The line that's throwing the exception was introduced during the internal
code review of PR #9864 <#9864>
and is part of fe7e5b8
<fe7e5b8>
.
It's failing because it's finding a second Opus identification header in
the file, which the spec (RFC7845) clearly forbids. The spec requires the
ID header to be in the first Ogg packet:
In section 3 <https://datatracker.ietf.org/doc/html/rfc7845#section-3>:
There are two mandatory header packets. The first packet in the logical
Ogg bitstream MUST contain the identification (ID) header, which uniquely
identifies a stream as Opus audio.
[...]
All subsequent pages are audio data pages, and the Ogg packets they
contain are audio data packets.
In section 5 <https://datatracker.ietf.org/doc/html/rfc7845#section-5>:
An Ogg Opus logical stream contains exactly two mandatory header packets:
an identification header and a comment header.
When looking at the file in a binary viewer, you can see two OpusHead
magic strings which identify the two ID headers [1].
So I think this media is invalid - but we can tweak ExoPlayer to be more
permissive here and only accept the first ID and comment headers it finds,
ignoring all subsequent ones - this more closely matches the behaviour from
2.16.1. I'll make that change.
------------------------------
[1]
$ hexdump -C seaOfMonsters-09.opus | less
00000000 4f 67 67 53 00 02 00 00 00 00 00 00 00 00 4e 38 |OggS..........N8|
00000010 b8 3f 00 00 00 00 c6 c9 2c 3a 01 13 4f 70 75 73 |.?......,:..Opus|
00000020 48 65 61 64 01 02 38 01 44 ac 00 00 00 00 00 4f |Head..8.D......O|
00000030 67 67 53 00 00 00 00 00 00 00 00 00 00 4e 38 b8 |ggS..........N8.|
00000040 3f 01 00 00 00 f2 19 0d 48 01 e5 4f 70 75 73 54 |?.......H..OpusT|
00000050 61 67 73 1f 00 00 00 6c 69 62 6f 70 75 73 20 31 |ags....libopus 1|
00000060 2e 33 2e 31 2c 20 6c 69 62 6f 70 75 73 65 6e 63 |.3.1, libopusenc|
00000070 20 30 2e 32 2e 31 07 00 00 00 0f 00 00 00 54 49 | 0.2.1........TI|
00000080 54 4c 45 3d 43 68 61 70 74 65 72 20 38 13 00 00 |TLE=Chapter 8...|
00000090 00 41 52 54 49 53 54 3d 52 69 63 6b 20 52 69 6f |.ARTIST=Rick Rio|
000000a0 72 64 61 6e 19 00 00 00 41 4c 42 55 4d 3d 54 68 |rdan....ALBUM=Th|
000000b0 65 20 53 65 61 20 6f 66 20 4d 6f 6e 73 74 65 72 |e Sea of Monster|
000000c0 73 09 00 00 00 44 41 54 45 3d 32 30 30 36 0e 00 |s....DATE=2006..|
000000d0 00 00 54 52 41 43 4b 4e 55 4d 42 45 52 3d 30 39 |..TRACKNUMBER=09|
000000e0 0d 00 00 00 54 52 41 43 4b 54 4f 54 41 4c 3d 32 |....TRACKTOTAL=2|
000000f0 32 3a 00 00 00 44 45 53 43 52 49 50 54 49 4f 4e |2:...DESCRIPTION|
00000100 3d 50 65 72 63 79 20 4a 61 63 6b 73 6f 6e 20 61 |=Percy Jackson a|
00000110 6e 64 20 74 68 65 20 4f 6c 79 6d 70 69 61 6e 73 |nd the Olympians|
00000120 20 53 65 72 69 65 73 2c 20 42 6f 6f 6b 20 32 01 | Series, Book 2.|
00000130 4f 67 67 53 00 00 00 00 00 00 00 00 00 00 4e 38 |OggS..........N8|
00000140 b8 3f 02 00 00 00 9a df f5 cc 01 13 4f 70 75 73 |.?..........Opus|
00000150 48 65 61 64 01 02 38 01 44 ac 00 00 00 00 00 4f |Head..8.D......O|
00000160 67 67 53 00 00 00 00 00 00 00 00 00 00 4e 38 b8 |ggS..........N8.|
00000170 3f 03 00 00 00 f8 84 63 5f 03 ff ff fe 4f 70 75 |?......c_....Opu|
00000180 73 54 61 67 73 1f 00 00 00 6c 69 62 6f 70 75 73 |sTags....libopus|
00000190 20 31 2e 33 2e 31 2c 20 6c 69 62 6f 70 75 73 65 | 1.3.1, libopuse|
000001a0 6e 63 20 30 2e 32 2e 31 02 00 00 00 23 00 00 00 |nc 0.2.1....#...|
000001b0 45 4e 43 4f 44 45 52 3d 6f 70 75 73 65 6e 63 20 |ENCODER=opusenc |
000001c0 66 72 6f 6d 20 6f 70 75 73 2d 74 6f 6f 6c 73 20 |from opus-tools |
000001d0 30 2e 32 15 00 00 00 45 4e 43 4f 44 45 52 5f 4f |0.2....ENCODER_O|
000001e0 50 54 49 4f 4e 53 3d 2d 2d 76 62 72 00 00 00 00 |PTIONS=--vbr....|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*
00000470 00 00 00 00 00 00 00 00 00 4f 67 67 53 00 00 80 |.........OggS...|
—
Reply to this email directly, view it on GitHub
<#10038 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAH7I7VOSUZACFODA4YB3PLU7C7AZANCNFSM5QILNHPQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This reinstates the permissive behaviour removed by fe7e5b8 Test file created by opening bear.opus in a hex editor and naively duplicating the two header packets, starting at (and including) the first `OggS` in the file and ending just before the third `OggS`. #minor-release Issue: google/ExoPlayer#10038 PiperOrigin-RevId: 452015662
This reinstates the permissive behaviour removed by fe7e5b8 Test file created by opening bear.opus in a hex editor and naively duplicating the two header packets, starting at (and including) the first `OggS` in the file and ending just before the third `OggS`. #minor-release Issue: #10038 PiperOrigin-RevId: 452015662
This reinstates the permissive behaviour removed by fe7e5b8 Test file created by opening bear.opus in a hex editor and naively duplicating the two header packets, starting at (and including) the first `OggS` in the file and ending just before the third `OggS`. #minor-release Issue: #10038 PiperOrigin-RevId: 452015662 (cherry picked from commit b6b2826)
This reinstates the permissive behaviour removed by fe7e5b8 Test file created by opening bear.opus in a hex editor and naively duplicating the two header packets, starting at (and including) the first `OggS` in the file and ending just before the third `OggS`. #minor-release Issue: google/ExoPlayer#10038 PiperOrigin-RevId: 452015662 (cherry picked from commit 1282175)
Trying to play the following opus file fails on v2.17.0 with the following stack
Playing the same file with 2.16.1 (and older versions works fine)
Tested on different devices and android version
seaOfMonsters-09-opus.zip
The text was updated successfully, but these errors were encountered: