diff options
author | wm4 <wm4@nowhere> | 2014-07-26 20:31:31 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-07-26 20:36:46 +0200 |
commit | 97a82bcd5693a00d876ca17406e5f699f5890cc9 (patch) | |
tree | 4d6031ce1999cbee0e82dd6155618c5a62e6739e /ta | |
parent | 760548da286400534017e885af123fffeb6cc707 (diff) | |
download | mpv-97a82bcd5693a00d876ca17406e5f699f5890cc9.tar.bz2 mpv-97a82bcd5693a00d876ca17406e5f699f5890cc9.tar.xz |
win32: move window handling to a separate thread
The windows message loop now runs in a separate thread. Rendering,
such as with Direct3D or OpenGL, still happens in the main thread.
In particular, this should prevent the video from freezing if the
window is dragged. (The reason was that the message dispatcher won't
return while the dragging is active, so mpv couldn't update the
video at all.)
This is pretty "rough" and just hacked in, and there's no API yet to
make this easier for other backends. It will be cleaned up later
once we're sure that it works, or when we know how exactly it should
work. One oddity is that OpenGL is actually completely managed in the
renderer thread, while e.g. Cocoa (which has its own threading code)
creates the context in the GUI thread, and then lets the renderer
thread access it.
One strange issue is that we now have to stop WM_CLOSE from actually
closing the window. Instead, we wait until the playloop handles the
close command, and requests the VO to shutdown. This is done mainly
because closing the window apparently destroys it, and then WM_USER
can't be handled anymore - which means the playloop has no way to
wakeup the GUI thread. It seems you can't really win here... maybe
there's a better way to have a thread receive messages with and
without a window, but I didn't find one yet.
Dragging the window (by clicking into the middle of it) behaves
strangely in wine, but didn't before the change. Reason unknown.
Diffstat (limited to 'ta')
0 files changed, 0 insertions, 0 deletions