Skip to content

Adjust LAME MP3 trim metadata to decoded PCM timeline#3200

Open
Tolriq wants to merge 1 commit intoandroidx:mainfrom
Tolriq:mp3_lame_trim_metadata
Open

Adjust LAME MP3 trim metadata to decoded PCM timeline#3200
Tolriq wants to merge 1 commit intoandroidx:mainfrom
Tolriq:mp3_lame_trim_metadata

Conversation

@Tolriq
Copy link
Copy Markdown
Contributor

@Tolriq Tolriq commented May 6, 2026

LAME/Xing encoder delay and padding fields are offset from the skip/discard samples used when trimming decoded PCM. Account for this offset for LAME, Lavf, and Lavc headers when parsing gapless metadata.

This matches the decoded PCM trimming expectations used by FFmpeg and updates extractor dumps and the gapless end-to-end assertion accordingly.

Test: ./gradlew :lib-extractor:testDebugUnitTest --tests androidx.media3.extractor.mp3.ConstantBitrateSeekerTest --tests androidx.media3.extractor.mp3.Mp3ExtractorTest --tests androidx.media3.extractor.mp3.XingFrameTest

Test: ./gradlew :lib-exoplayer:testDebugUnitTest --tests androidx.media3.exoplayer.e2etest.EndToEndGaplessTest

LAME/Xing encoder delay and padding fields are offset from the skip/discard samples used when trimming decoded PCM. Account for this offset for LAME, Lavf, and Lavc headers when parsing gapless metadata.

This matches the decoded PCM trimming expectations used by FFmpeg and updates extractor dumps and the gapless end-to-end assertion accordingly.

Test: ./gradlew :lib-extractor:testDebugUnitTest --tests androidx.media3.extractor.mp3.ConstantBitrateSeekerTest --tests androidx.media3.extractor.mp3.Mp3ExtractorTest --tests androidx.media3.extractor.mp3.XingFrameTest

Test: ./gradlew :lib-exoplayer:testDebugUnitTest --tests androidx.media3.exoplayer.e2etest.EndToEndGaplessTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant