Commit 76b933b5 authored by Sergey Radionov's avatar Sergey Radionov Committed by Rafaël Carré

win32: use PostMessage in event handlers to avoid deadlocks

when main thread wait something. It's fixing "stop" bug.
Signed-off-by: Rafaël Carré's avatarRafaël Carré <funman@videolan.org>
parent 382ed111
......@@ -498,7 +498,7 @@ void VLCControlsWnd::SetVideoPosScrollRangeByVideoLen()
void VLCControlsWnd::SetVideoPosScrollPosByVideoPos(libvlc_time_t CurScrollPos)
{
SendMessage(hVideoPosScroll, (UINT)PBM_SETPOS, (WPARAM) (CurScrollPos >> VideoPosShiftBits), 0);
PostMessage(hVideoPosScroll, (UINT)PBM_SETPOS, (WPARAM) (CurScrollPos >> VideoPosShiftBits), 0);
}
void VLCControlsWnd::SetVideoPos(float Pos) //0-start, 1-end
......@@ -561,15 +561,15 @@ void VLCControlsWnd::handle_input_state_event(const libvlc_event_t* event)
switch( event->type )
{
case libvlc_MediaPlayerPlaying:
SendMessage(hPlayPauseButton, BM_SETIMAGE,
PostMessage(hPlayPauseButton, BM_SETIMAGE,
(WPARAM)IMAGE_BITMAP, (LPARAM)RC().hPauseBitmap);
break;
case libvlc_MediaPlayerPaused:
SendMessage(hPlayPauseButton, BM_SETIMAGE,
PostMessage(hPlayPauseButton, BM_SETIMAGE,
(WPARAM)IMAGE_BITMAP, (LPARAM)RC().hPlayBitmap);
break;
case libvlc_MediaPlayerStopped:
SendMessage(hPlayPauseButton, BM_SETIMAGE,
PostMessage(hPlayPauseButton, BM_SETIMAGE,
(WPARAM)IMAGE_BITMAP, (LPARAM)RC().hPlayBitmap);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment