Skip to content

fix multichannel flac import - #10679

Merged
kryksyh merged 1 commit into
audacity:masterfrom
kryksyh:fix_multichannel_flac_import
Apr 9, 2026
Merged

kryksyh merged 1 commit into
audacity:masterfrom
kryksyh:fix_multichannel_flac_import

Conversation

@kryksyh

@kryksyh kryksyh commented Apr 8, 2026

Copy link
Copy Markdown
Member

Resolves: #6381

import as a multitrack list instead of a single track

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Autobot test cases have been run

@kryksyh
kryksyh requested a review from grliszas14 April 8, 2026 16:53
@kryksyh kryksyh self-assigned this Apr 8, 2026
@coderabbitai

coderabbitai Bot commented Apr 8, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: e3d7e49f-4177-4f99-b733-ca9d9c5fda65

📥 Commits

Reviewing files that changed from the base of the PR and between 47fe7a15abedc1aa3f32599b8c1b17b6fdeea3d4 and de79fa2.

📒 Files selected for processing (2)
  • au3/modules/import-export/mod-flac/ImportFLAC.cpp
  • au3/modules/import-export/mod-flac/ImportFLAC.h

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Improved FLAC import to handle multi-track files end-to-end, aligning decoding and finalization for reliable multi-channel audio import.
  • Bug Fixes
    • Fixed incorrect single-track behavior so multi-track FLAC files now import correctly and preserve separate tracks.

Walkthrough

The FLAC importer now handles multi-channel files by replacing the single WaveTrack::Holder mTrack with TrackListHolder mTracks. MyFLACFile::write_callback writes decoded samples into each channel by iterating mFile->mTracks. Import creation uses trackFactory->CreateMany(...) with ImportUtils::ChooseFormat(mFormat) to populate mTracks, and import finalization transfers ownership via ImportUtils::FinalizeImport(outTracks, std::move(*mTracks)).

Sequence Diagram(s)

sequenceDiagram
    participant Decoder as FLAC decoder
    participant MyFLACFile as MyFLACFile
    participant FLACHandle as FLACImportFileHandle
    participant TrackFactory as TrackFactory
    participant ImportUtils as ImportUtils
    participant Out as OutTracks

    Note over FLACHandle,TrackFactory: Import start
    FLACHandle->>TrackFactory: CreateMany(format) -> TrackListHolder mTracks
    Decoder->>MyFLACFile: decoded_frame(callback)
    MyFLACFile->>MyFLACFile: iterate mFile->mTracks, append samples
    MyFLACFile-->>FLACHandle: samples written into mTracks
    FLACHandle->>ImportUtils: FinalizeImport(outTracks, move(*mTracks))
    ImportUtils->>Out: deliver finalized tracks
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • fix multichannel flac import #10679: Makes the same code-level changes converting FLAC import from a single mTrack to a multi-track mTracks flow (create-many, write per-track, finalize with moved track list).

Suggested reviewers

  • grliszas14
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix multichannel flac import' is concise and directly describes the main change: addressing multichannel FLAC import functionality, which aligns with the changeset.
Description check ✅ Passed The PR description follows the template structure, includes a reference to issue #6381, provides a clear description of changes (multitrack list vs single track), and has all checklist items completed except autobot tests.
Linked Issues check ✅ Passed The code changes directly address issue #6381 by switching from single-track (mTrack) to multi-track (mTracks) import, allowing proper handling of multichannel FLAC files as separate tracks.
Out of Scope Changes check ✅ Passed All changes are focused on FLAC import handling, modifying only the track storage mechanism from single to multi-track within ImportFLAC files, which is directly aligned with the stated objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@kryksyh kryksyh mentioned this pull request Apr 8, 2026
6 of 7 tasks
@kryksyh
kryksyh force-pushed the fix_multichannel_flac_import branch from 47fe7a1 to de79fa2 Compare April 9, 2026 15:24
@kryksyh
kryksyh merged commit bde3d14 into audacity:master Apr 9, 2026
5 checks passed
@kryksyh
kryksyh deleted the fix_multichannel_flac_import branch April 9, 2026 15:24
@coderabbitai coderabbitai Bot mentioned this pull request Apr 10, 2026
9 of 10 tasks
kryksyh added a commit that referenced this pull request Apr 14, 2026
Resolves: #6381

cherry pick of: #10679

<!-- Use "x" to fill the checkboxes below like [x] -->

- [x] I signed [CLA](https://www.audacityteam.org/cla/)
- [x] The title of the pull request describes an issue it addresses
- [x] If changes are extensive, then there is a sequence of easily
reviewable commits
- [x] Each commit's message describes its purpose and effects
- [x] There are no behavior changes unnecessary for the stated purpose
of the PR

Recommended:
- [x] Each commit compiles and runs on my machine without known
undesirable changes of behavior

QA:

- [ ] Autobot test cases have been run
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.

Multi-channel is added as one mono channel

2 participants