1.19.3#413
Open
XChikuX wants to merge 6 commits into
Open
Conversation
Replaces the MP3-only jlayer Converter with a MediaCodec/MediaExtractor-based decoder that handles any audio container/codec Android can play (m4a/AAC, mp3, ogg, flac, etc.), outputting 16-bit PCM WAV that LAME can consume.
NSException.raise() aborts the whole process and no JS catch can intercept it. Swift throw lets the caller reject the promise instead.
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.
Summary
This PR brings the v1 branch up to date with critical fixes for Android audio compression and video codec handling, along with cleanup of long-dead code.
Bug Fixes
1. Android AudioCompressor: m4a/AAC files produced silent/broken MP3s
Root cause:
AudioCompressor.ktusedjavazoom:jlayer'sConverterto transcode non-WAV inputs to WAV before LAME encoding. However, jlayer's Converter is MP3-only — it silently throws and swallowsJavaLayerExceptionfor AAC/m4a/ogg/flac input, producing an empty/broken WAV. LAME then encoded that empty WAV deterministically into a few KB of MP3 silence, and the failure was completely invisible to the caller (promise resolved successfully with the broken file path).Fix: Replaced jlayer with a new
AudioTranscoder.ktthat uses Android's built-inMediaExtractor+MediaCodecpipeline — the same decoder stack the platform uses for normal audio playback. This handles any audio format Android can decode: m4a/AAC, MP3, OGG, FLAC, video audio tracks, etc.2. Issue #410:
Unresolved reference 'ensureDecodableVideoFormat'Root cause: The
ensureDecodableVideoFormat()helper was referenced inprepareDecoder()but never defined, causing Android builds to fail.Fix: Added the missing
ensureDecodableVideoFormat()function which remapsvideo/dolby-vision→video/hevcfor profiles 8.x (profile 5 is already rejected upstream instart()), restoring Dolby Vision video support on affected devices.3. Pre-existing swallowed exceptions in
AudioCompressor.ktFixed six related issues where errors were silently caught and swallowed, causing degenerate outputs to be returned as "success":
openWave()IOException→ now rejects the promiseoutputStreamFileNotFoundException→ now rejects the promisecatch (Exception)→ now rejects the promise instead of resolving the original URLCleanup
AudioExtractor.kt— entirely unused class (never imported by any other file)javazoom:jlayer:1.0.1frombuild.gradle— unused dependencyDocumentation
README.mdclarifying that v1 is in maintenance mode and v2 (Nitro Modules) is the active development lineXChikuX/react-native-compressor