Skip to content

swresample: pass input layout in mpv's order via custom channel order#18034

Open
kasper93 wants to merge 2 commits into
mpv-player:masterfrom
kasper93:swr
Open

swresample: pass input layout in mpv's order via custom channel order#18034
kasper93 wants to merge 2 commits into
mpv-player:masterfrom
kasper93:swr

Conversation

@kasper93
Copy link
Copy Markdown
Member

No description provided.

Since 9ef614d this helper has been a no-op. fudge_layout_conversion() returned the modified uint64_t channel-layout bitmask, but the new AVChannelLayout path builds out_layout from the unfudged out_lavc and feeds that to swr.

Even when it was wired up, libswresample handles the BL/BR <-> SL/SR
mapping if needed. SDL/SDR is not currently handled, but I would rather
patch the swr/rematrix.c for those too, instead of having custom glue
here.

Note that SDL/SDR are not that common in-practice.
Comment thread audio/chmap_avchannel.c Outdated
Drop the swr_set_channel_mapping() + transpose_order() + reorder_in[]
plumbing. Instead, build the swr input channel layout directly from the
mpv chmap as AV_CHANNEL_ORDER_CUSTOM, so the labels in the layout already
match the positions of the channels in the input data.

For all unknown map, we return all UNSPEC, so the swr expands to default
layout for this channel number.
Copy link
Copy Markdown
Member

@Dudemanguy Dudemanguy left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@jeeb jeeb left a comment

Choose a reason for hiding this comment

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

LGTM

Cleans up things nicely. Doing custom layouts specifically even when they possibly match an FFmpeg standard layout is a bit specific, but I don't really see it as a too big negative. We will anyways have to handle custom channel layouts in chmap_avchannel at some point.

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.

3 participants