Skip to content

Use the SDK's MP3 timeline for decoding and conversion - #14

Merged
claw1200 merged 5 commits into
mainfrom
mp3-timeline-delay
Oct 27, 2026
Merged

claw1200 merged 5 commits into
mainfrom
mp3-timeline-delay

Conversation

@claw1200

Copy link
Copy Markdown
Owner

Depends on claw1200/es-rekordbox-sdk#1; the submodule points at that branch until it merges.

  • es-decode drops mp3.rs and takes the lead from rb_audio::rekordbox_lead_frames. The SDK rule can give a negative lead, so Streamer now drops that many decoded frames at the start (and on seeks).
  • Conversion's offset is rb_audio::conversion_shift_ms: delay plus lead on each end, read from the files. It now includes the frame lead the old code missed (a LAME MP3 to an ffmpeg MP3 was 26 ms off).
  • When either file does not state its delay, nothing is moved. This changes M4A/AAC/Ogg sources, which were previously treated as zero delay and are now left alone.

Not covered: the beat grid is shifted in the ANLZ files but the cue tags in them are not (only the database cues are).

Tests: es-decode and es-engine pass; the delay logic is tested in the SDK. There is no Streamer test for a negative lead yet.

claw1200 added 2 commits October 24, 2026 21:14
es-decode takes the rekordbox lead from rb-audio (including a negative lead) and its own copy is removed. Conversion shifts cues and the beat grid by the difference in each file's content start, and moves nothing when either file does not state its delay.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Negative-lead playback, decoded length, and seeking need Streamer regression coverage before approval.

1 open issue
What changed in this PR

This PR centralizes MP3 timeline calculations in the SDK so decoding and conversion use the same timing rules.

Changes:

  • Replaces local MP3 parsing with SDK timeline helpers.
  • Supports negative lead values in playback length, initial trimming, and seeking.
  • Uses file-reported delays for conversion offsets, leaving timing unchanged when either delay is unknown.
File Description
native/​crates/​es-engine/​src/​convert.rs Delegates conversion offsets to the SDK and handles unknown delays.
native/​crates/​es-engine/​Cargo.toml Adds the rb-audio dependency.
native/​crates/​es-decode/​src/​mp3.rs Removes the local MP3 lead parser and its tests.
native/​crates/​es-decode/​src/​lib.rs Uses SDK lead values and supports negative-lead trimming and seeking.
native/​crates/​es-decode/​Cargo.toml Adds the rb-audio dependency.
native/​Cargo.toml Registers the SDK audio crate as a workspace dependency.
native/​Cargo.lock Records the new audio dependency.

Review effort: Balanced

Comment thread native/crates/es-decode/src/lib.rs Resolved
@claw1200
claw1200 merged commit 71d51a2 into main Oct 27, 2026
3 checks passed
@claw1200
claw1200 deleted the mp3-timeline-delay branch October 27, 2026 15:22
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.

2 participants