Skip to content

Commit

Permalink
vo: signal VOCTRL_REDRAW in a less sensitive spot
Browse files Browse the repository at this point in the history
Windows works totally differently than the other backends and is
sensitive to synchronization issues since it runs its control on a
separate thread. The spot where this was originally placed was a perfect
storm of causing resize weirdness because it was before the flip and
right after the redraw. Ideally, this is known to the windowing backend
before the flip actually happens so just move this out to before the
do_redraw call. It makes no practical difference for the one user of
this and sidesteps the implementation differences that exist on Windows.
Fixes fc9d1ca.
  • Loading branch information
Dudemanguy committed Feb 25, 2025
1 parent 5459b0f commit d79eba1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion video/out/vo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,6 @@ static void do_redraw(struct vo *vo)
mp_mutex_unlock(&in->lock);

vo->driver->draw_frame(vo, frame);
vo->driver->control(vo, VOCTRL_REDRAW, NULL);
vo->driver->flip_page(vo);

if (frame != &dummy && !vo->driver->frame_owner)
Expand Down Expand Up @@ -1180,6 +1179,7 @@ static MP_THREAD_VOID vo_thread(void *ptr)
if (send_pause)
vo->driver->control(vo, vo_paused ? VOCTRL_PAUSE : VOCTRL_RESUME, NULL);
if (wait_until > now && redraw) {
vo->driver->control(vo, VOCTRL_REDRAW, NULL);
do_redraw(vo); // now is a good time
continue;
}
Expand Down

0 comments on commit d79eba1

Please sign in to comment.