Fix 14-bit DTS frame size calculation#3330
Open
Tolriq wants to merge 1 commit into
Open
Conversation
ETSI TS 102 114 V1.2.1 section 5.3 defines 14-bit DTS storage as one 14-bit payload word in the least significant bits of each 16-bit word. Convert FSIZE+1 to a whole number of 14-bit words before mapping those words to physical bytes. The previous fsize * 16 / 14 calculation could produce an impossible odd physical size. For common DTS-CD headers with FSIZE+1 equal to 3585 it returned 4097 bytes, although consecutive sync words are 4096 bytes apart. DtsReader then consumed the first byte of the next sync word and failed to recognize subsequent frames. Add direct coverage for little- and big-endian 14-bit headers and for an already-exact conversion. Test: ./gradlew :lib-extractor:testDebugUnitTest --tests androidx.media3.extractor.DtsUtilTest
|
Hi, do u have any test stream? |
Contributor
Author
|
Not directly usable here as they are dts in wav that is not supported by the current extractors. But since those dtsutils and reader are reusable I supposed the fix still have it's place upstream. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ETSI TS 102 114 V1.2.1 section 5.3 defines 14-bit DTS storage as one 14-bit payload word in the least significant bits of each 16-bit word. Convert FSIZE+1 to a whole number of 14-bit words before mapping those words to physical bytes.
The previous fsize * 16 / 14 calculation could produce an impossible odd physical size. For common DTS-CD headers with FSIZE+1 equal to 3585 it returned 4097 bytes, although consecutive sync words are 4096 bytes apart. DtsReader then consumed the first byte of the next sync word and failed to recognize subsequent frames.
Add direct coverage for little- and big-endian 14-bit headers and for an already-exact conversion.
Test: ./gradlew :lib-extractor:testDebugUnitTest --tests androidx.media3.extractor.DtsUtilTest