Harden ChannelLayoutConfig constraints [chromium/src : main]

0 views
Skip to first unread message

Thomas Guilbert (Gerrit)

unread,
Feb 11, 2026, 5:02:00 PM (11 hours ago) Feb 11
to Thomas Guilbert, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org
Attention needed from Dale Curtis

Thomas Guilbert added 1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Thomas Guilbert . resolved

PTAL, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Dale Curtis
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I50411f32acbe1250ded5cbaea7358b1f083d881a
Gerrit-Change-Number: 7564649
Gerrit-PatchSet: 5
Gerrit-Owner: Thomas Guilbert <tgui...@chromium.org>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Feb 2026 22:01:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dale Curtis (Gerrit)

unread,
Feb 11, 2026, 5:55:34 PM (10 hours ago) Feb 11
to Thomas Guilbert, Cedric Tio, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org
Attention needed from Cedric Tio and Thomas Guilbert

Dale Curtis added 1 comment

File media/base/channel_layout.cc
Line 189, Patchset 5 (Latest): CHECK(channels == 6 || channels == 10);
Dale Curtis . unresolved

@cedri...@xperi.com Can we change this to 6?

Open in Gerrit

Related details

Attention is currently required from:
  • Cedric Tio
  • Thomas Guilbert
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I50411f32acbe1250ded5cbaea7358b1f083d881a
    Gerrit-Change-Number: 7564649
    Gerrit-PatchSet: 5
    Gerrit-Owner: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-CC: Cedric Tio <cedri...@xperi.com>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Cedric Tio <cedri...@xperi.com>
    Gerrit-Comment-Date: Wed, 11 Feb 2026 22:55:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Cedric T (Gerrit)

    unread,
    Feb 11, 2026, 9:32:33 PM (6 hours ago) Feb 11
    to Thomas Guilbert, Cedric Tio, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org
    Attention needed from Cedric Tio and Thomas Guilbert

    Cedric T added 1 comment

    File media/base/channel_layout.cc
    Line 189, Patchset 5 (Latest): CHECK(channels == 6 || channels == 10);
    Dale Curtis . unresolved

    @cedri...@xperi.com Can we change this to 6?

    Cedric T
    ```How about:

    CHECK(channels == 6 || channels == 10);
        if (channels == 10)
    channels = 6;
    ```The above is to cater to the case where the incoming is a 5.1.4 bitstream with actual channel count of 10. So somehow, ComputeChannelCount() gets called with CHANNEL_LAYOUT_5_1_4_DOWNMIX and channels == 10. We want to allow this case to go through and remapped the channels from 10 to 6. If such a case will never happen (because channels are mapped to 6 by some earlier code), then I think it should be safe to just always return 6 when channel_layout == CHANNEL_LAYOUT_5_1_4_DOWNMIX? Thanks.
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cedric Tio
    • Thomas Guilbert
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I50411f32acbe1250ded5cbaea7358b1f083d881a
    Gerrit-Change-Number: 7564649
    Gerrit-PatchSet: 5
    Gerrit-Owner: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-CC: Cedric T <cedr...@gmail.com>
    Gerrit-CC: Cedric Tio <cedri...@xperi.com>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Cedric Tio <cedri...@xperi.com>
    Gerrit-Comment-Date: Thu, 12 Feb 2026 02:32:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Thomas Guilbert (Gerrit)

    unread,
    2:46 AM (1 hour ago) 2:46 AM
    to Thomas Guilbert, Cedric T, Cedric Tio, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org
    Attention needed from Cedric T, Cedric Tio and Dale Curtis

    Thomas Guilbert added 1 comment

    File media/base/channel_layout.cc
    Line 189, Patchset 5: CHECK(channels == 6 || channels == 10);
    Dale Curtis . unresolved

    @cedri...@xperi.com Can we change this to 6?

    Cedric T
    ```How about:
    CHECK(channels == 6 || channels == 10);
    if (channels == 10)
    channels = 6;
    ```The above is to cater to the case where the incoming is a 5.1.4 bitstream with actual channel count of 10. So somehow, ComputeChannelCount() gets called with CHANNEL_LAYOUT_5_1_4_DOWNMIX and channels == 10. We want to allow this case to go through and remapped the channels from 10 to 6. If such a case will never happen (because channels are mapped to 6 by some earlier code), then I think it should be safe to just always return 6 when channel_layout == CHANNEL_LAYOUT_5_1_4_DOWNMIX? Thanks.
    Thomas Guilbert

    Forcing this down to 6 channels seems reasonable to me, but there is still a risk for a 6 vs 10 mismatch, if a caller passes and uses 10, and downstream code relies on the calculated 6.

    We are currently looking at adding an actual `CHANNEL_LAYOUT_5_1_4` layout. Afterwards, `CHANNEL_LAYOUT_5_1_4_DOWNMIX` should always be 6 (and really just be `CHANNEL_LAYOUT_5_1`). Considering this, I would like to get rid of this special case entirely one day.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cedric T
    • Cedric Tio
    • Dale Curtis
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I50411f32acbe1250ded5cbaea7358b1f083d881a
    Gerrit-Change-Number: 7564649
    Gerrit-PatchSet: 6
    Gerrit-Owner: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-CC: Cedric T <cedr...@gmail.com>
    Gerrit-CC: Cedric Tio <cedri...@xperi.com>
    Gerrit-Attention: Cedric T <cedr...@gmail.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Cedric Tio <cedri...@xperi.com>
    Gerrit-Comment-Date: Thu, 12 Feb 2026 07:46:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Cedric T <cedr...@gmail.com>
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages