Skip to content

swift build fails: CFRRewriter memberwise initializer is inaccessible (private) #787

Closed

Description

@ijuniorfu

What happened?

Description

Building the package fails in H264MatroskaSlotPermutation.swift:

Sources/AetherEngine/Video/H264MatroskaSlotPermutation.swift:624:28: error:
'H264MatroskaSlotPermutation.CFRRewriter' initializer is inaccessible due to 'private' protection level

Steps to reproduce

  1. Check out main (1d6c5a0 at the time of writing).
  2. Run swift build.

Environment

  • Apple Swift 6.3.3 (swiftlang-6.3.3.1.3), arm64-apple-macosx26.0.

Cause

CFRRewriter (introduced in b76b115, "reconstruct clamped Matroska H264 timestamps") has private stored properties:

struct CFRRewriter {
    let step: Int64
    let pocStep: Int64
    let videoDelay: Int
    private(set) var brokenReason: String?
    private var anchorPTS: Int64?
    private var decodeIndex: Int64 = 0
    ...
}

Swift makes the synthesized memberwise initializer private when any stored property is private. The call site is outside the struct, in the .reconstruct branch of the enclosing class:

var rewriter = H264MatroskaSlotPermutation.CFRRewriter(
    step: step, pocStep: pocStep, videoDelay: videoDelay)

Tests/AetherEngineTests/Issue511MatroskaCodingOrderTests.swift calls the same initializer at lines 216, 240 and 267, so the tests should hit the same error.

Result

The AetherEngine target does not compile, so nothing that depends on the package builds, and the CFRRewriter tests cannot compile either.

Suggested fix

Declare the initializer explicitly inside CFRRewriter:

init(step: Int64, pocStep: Int64, videoDelay: Int) {
    self.step = step
    self.pocStep = pocStep
    self.videoDelay = videoDelay
}

With that added, the package builds and the call sites are unchanged.

Steps to reproduce

none

AetherEngine version or commit SHA

b5d9a1e

Host app

Custom / my own integration

Platform

iOS

OS version

iOS

Device / chip

iPhone

Playback path

Native AVPlayer

Source media (for playback bugs)

No response

Error codes / log lines


Anything else

No response

Activity

  1. added
    bug
    on Oct 15, 2026
  2. added a commit that references this issue on Oct 15, 2026
  3. superuser404notfound commented on Oct 15, 2026

    @superuser404notfound
    Owner

    Thank you @ijuniorfu, a precise report with the cause and the fix already worked out. Fixed in #789, merged as 2eb5915, with the initializer written out as suggested.

    The reason it slipped through: CI and the release builds run on Xcode 27 (Swift 6.4), which leaves private stored properties with a default out of the memberwise initializer, so the synthesized one stayed internal there. Earlier compilers make it private. A scan of Sources/ and Tests/ found no second struct with that shape.

    The README lists Xcode 27 as the tested toolchain, so older ones are not covered by CI. If anything else fails to compile on 6.3, a report like this one is welcome.

    The break came in with #762 and was never in a release; the fix ships with it in the next AetherEngine release. I am leaving this open until it builds for you.

  4. superuser404notfound commented on Oct 15, 2026

    @superuser404notfound
    Owner

    Released in 7.37.0 (a3db0d7): the CFRRewriter initializer is spelled out, so the package builds on toolchains before Swift 6.4 again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions