Repository navigation
Conversation
Anamorphic sources store non-square pixels (a 720x480 DVD rip flagged 16:9). The video output built each sample buffer from the stored size alone, so AVSampleBufferDisplayLayer drew them squeezed. Attach kCVImageBufferPixelAspectRatioKey from the frame's p_w and p_h, on both the plain and the composited path. Square pixel frames are left alone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BsaHcCXUsC4JTpKgBe2AgJ
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Anamorphic video plays squashed on iOS. A 720x480 DVD style rip flagged 16:9 is drawn at its stored 3:2 shape, because the avfoundation video output builds each sample buffer from the decoded pixels alone and never tells
AVSampleBufferDisplayLayerhow wide a pixel is.This attaches
kCVImageBufferPixelAspectRatioKey(from the frame'sp_wandp_h) to the pixel buffer before the format description is created, on both the plain path and the composited subtitle path. The layer then stretches the frame to its display aspect, so fit, fill and picture in picture follow without any app change. Frames with square pixels, or no pixel aspect, are left alone.Reported in the app repo: streamyfin/streamyfin#2369 (Swiftfin shows the same file correctly, Streamyfin does not).
The change is one helper,
set_pixel_aspect(), and two calls, all inside0004-avfoundation-video-output.patch. I also corrected the new file hunk header (+1,1311) to match.How it was tested
HorizontalSpacing=32, VerticalSpacing=27on a realCVPixelBuffer..mkv) all show a round circle and a square box. Before the patch the anamorphic ones were squashed.Not verified
Using this needs a new release tag and a podspec bump in the app, so this does not close the app issue by itself.
AI assisted: drafted and tested with Claude Code.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BsaHcCXUsC4JTpKgBe2AgJ