player/video: fallback to audio sync logic if VO is not visible

The previous commit put all the pieces in place so now this can be
implemented. Scheduling frames is already written with the assumption
that display sync maybe turn on/off at any time. So all that needs to be
done is check if the VO reports that it is not visible. If so, simply
flip mpctx->display_sync_active to false for that frame and skip the
display sync frame handling. It will become true again when the mpv
window comes back into view.
This commit is contained in:
Dudemanguy
2024-12-20 12:47:39 -06:00
parent 91c1b65de0
commit a2fe5ee900
3 changed files with 15 additions and 2 deletions

View File

@@ -820,8 +820,9 @@ static void handle_display_sync_frame(struct MPContext *mpctx,
mpctx->display_sync_active = false;
if (!VS_IS_DISP(mode))
if (!VS_IS_DISP(mode) || !vo_is_visible(vo))
return;
bool resample = mode == VS_DISP_RESAMPLE || mode == VS_DISP_RESAMPLE_VDROP ||
mode == VS_DISP_RESAMPLE_NONE;
bool drop = mode == VS_DISP_VDROP || mode == VS_DISP_RESAMPLE ||