Skip to content

1.19.3#413

Open
XChikuX wants to merge 6 commits into
numandev1:1.19.2from
XChikuX:1.19.3
Open

1.19.3#413
XChikuX wants to merge 6 commits into
numandev1:1.19.2from
XChikuX:1.19.3

Conversation

@XChikuX

@XChikuX XChikuX commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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.kt used javazoom:jlayer's Converter to transcode non-WAV inputs to WAV before LAME encoding. However, jlayer's Converter is MP3-only — it silently throws and swallows JavaLayerException for 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.kt that uses Android's built-in MediaExtractor + MediaCodec pipeline — 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 in prepareDecoder() but never defined, causing Android builds to fail.

Fix: Added the missing ensureDecodableVideoFormat() function which remaps video/dolby-visionvideo/hevc for profiles 8.x (profile 5 is already rejected upstream in start()), restoring Dolby Vision video support on affected devices.

3. Pre-existing swallowed exceptions in AudioCompressor.kt

Fixed six related issues where errors were silently caught and swallowed, causing degenerate outputs to be returned as "success":

  • openWave() IOException → now rejects the promise
  • outputStream FileNotFoundException → now rejects the promise
  • Outer catch (Exception) → now rejects the promise instead of resolving the original URL
  • Temp WAV file leaked on failure → now deleted on both success and failure paths

Cleanup

  • Removed AudioExtractor.kt — entirely unused class (never imported by any other file)
  • Removed javazoom:jlayer:1.0.1 from build.gradle — unused dependency

Documentation

  • Added legacy notice to README.md clarifying that v1 is in maintenance mode and v2 (Nitro Modules) is the active development line
  • Updated remote to XChikuX/react-native-compressor

XChikuX added 3 commits July 14, 2026 19:00
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.
@XChikuX XChikuX mentioned this pull request Jul 14, 2026
XChikuX added 3 commits July 14, 2026 19:37
NSException.raise() aborts the whole process and no JS catch can
intercept it.
Swift throw lets the caller reject the promise instead.
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