Repository navigation
Conversation
vo_avfoundation drew subtitles through the legacy osd_draw() callback, which mpv calls once per OSD object: primary subtitles, secondary subtitles, OSD text and script overlays each arrive in a separate call. Every call replaced the cached overlay, so only the last object survived. With secondary-sid set, the primary track disappeared. Use osd_render() and draw the whole sub_bitmap_list into one image over the union of its bounds, in both composite and CALayer mode. An empty list still clears the overlay, which replaces the osd_callback_invoked flag.
|
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 ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
demrom
marked this pull request as ready for review
October 15, 2026 16:02
This was referenced Oct 17, 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
With both
sidandsecondary-sidset, vo_avfoundation shows only one of the two subtitle tracks.The driver draws through mpv's legacy
osd_draw(), which calls its callback once per OSD object. Primary and secondary subtitles are separate objects, anddraw_osd_cbreplaced the cached overlay on every call, so only the last object stayed on screen.The driver now calls
osd_render()and draws the wholesub_bitmap_listinto one image covering the union of all parts' bounds, in composite mode and in CALayer mode. An empty list still clears the overlay, so theosd_callback_invokedflag is gone.Only the
vo_avfoundation.msection of patch 0004 changes. Its diffstat, hunk length and blob hash are updated to match. Most of the diff is the drawing loop moving one level in, so "Hide whitespace" makes it easier to read.Ticket / Issue
Refs streamyfin/streamyfin#960, which asks for two subtitle tracks at once. On iOS that needs this fix first.
Testing
git applyto a clean mpv v0.41.0, the waybase.swiftapplies them.vo_avfoundation.mcompiles for iOS arm64 with the libmpv build's own compile command. The one existing warning (label followed by a declaration) is unchanged.vo_avfoundation.m, stubsosd_render()to return two subtitle objects (one at the bottom, one at the top) and callsrender_osd(). Before this change the bottom object is fully transparent in the overlay in both composite and CALayer mode. After it, both objects are opaque in both modes, and an empty list clears the overlay.