Fix low-FPS iOS PiP by reporting swaps while PiP is active

Since 1d9c5e3b performRender feeds swap timing to mpv via
mpv_render_context_report_swap, but only after presentRenderbuffer -
which is skipped while PiP is active. Once swap reports stop mid-stream,
display-vdrop's vsync estimation goes stale and mpv drops nearly every
frame (vo drop counter climbing ~19/s on a 24fps stream), turning PiP
into a slideshow.

The frame is genuinely displayed during PiP via the
AVSampleBufferDisplayLayer, so report the swap on that path too.
This commit is contained in:
Arkadiusz Fal
2026-06-15 09:26:43 +02:00
parent 1157eef201
commit 4effe5d7a5

View File

@@ -907,6 +907,12 @@ final class MPVRenderView: UIView {
// macOS render views already do this.
mpvClient.reportSwap()
}
} else {
// PiP active: the frame is displayed via the PiP sample buffer layer instead
// of presentRenderbuffer. Keep feeding swap timing to mpv display-vdrop
// relies on it once reports have started, and starving it makes mpv drop
// nearly every frame (low-FPS PiP).
mpvClient.reportSwap()
}
// Warn on GPU stalls: a render+present that takes far longer than a frame