mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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:
@@ -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 ||
|
||||
|
||||
Reference in New Issue
Block a user