The branch, master has been updated
via 850cd209b72532976b5c66196945a59fb7d1f2d7 (commit)
via e49b7ab38680a0ff951ce1731cf191157e9e7d1b (commit)
via 7a467f5f5b7fd03dd39f4a3fbab73ede51fd4a6b (commit)
via 6dfcbc9f926e745bf902f7a8bfd2335e287346b7 (commit)
from 0d521e50049dab5b7543384f4de54c6bc4645ef4 (commit)
https://github.com/xbmc/xbmc/commit/850cd209b72532976b5c66196945a59fb7d1f2d7
commit 850cd209b72532976b5c66196945a59fb7d1f2d7
Merge: 0d521e5 e49b7ab
Author: wsoltys <wiso@...>
Date: Mon Aug 6 13:59:39 2012 -0700
Merge pull request #1247 from zewt/win32-not-exiting
[WIN32] Fix the process not exiting fully on alt-F4 during video playback (closes #13177)
https://github.com/xbmc/xbmc/commit/e49b7ab38680a0ff951ce1731cf191157e9e7d1b
commit e49b7ab38680a0ff951ce1731cf191157e9e7d1b
Author: Glenn Maynard <glenn@...>
Date: Sun Aug 5 19:24:37 2012 -0400
Fix m_pBuffer->Play errors not being logged.
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
index 108a5c9..e9a6495 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
@@ -644,8 +644,9 @@ void CAESinkDirectSound::CheckPlayStatus()
if (!(status & DSBSTATUS_PLAYING) && m_CacheLen != 0) // If we have some data, see if we can start playback
{
HRESULT hr = m_pBuffer->Play(0, 0, DSBPLAY_LOOPING);
- dserr2str(hr);
CLog::Log(LOGDEBUG,__FUNCTION__ ": Resuming Playback");
+ if (FAILED(hr))
+ CLog::Log(LOGERROR, __FUNCTION__": Failed to play the DirectSound buffer: %s", dserr2str(hr));
}
}
https://github.com/xbmc/xbmc/commit/7a467f5f5b7fd03dd39f4a3fbab73ede51fd4a6b
commit 7a467f5f5b7fd03dd39f4a3fbab73ede51fd4a6b
Author: Glenn Maynard <glenn@...>
Date: Sun Aug 5 19:22:47 2012 -0400
Move g_hWnd to WinEventsWin32.
If WinEventsWin32 is going to clear g_hWnd, then it should set it and
own it, too. WinSystemWin32 doesn't need to know about g_hWnd at all;
just use m_hWnd.
diff --git a/xbmc/windowing/windows/WinEventsWin32.cpp b/xbmc/windowing/windows/WinEventsWin32.cpp
index 92e3606..ee3a8b6 100644
--- a/xbmc/windowing/windows/WinEventsWin32.cpp
+++ b/xbmc/windowing/windows/WinEventsWin32.cpp
@@ -48,7 +48,7 @@
using namespace PERIPHERALS;
-extern HWND g_hWnd;
+HWND g_hWnd = NULL;
#define XBMC_arraysize(array) (sizeof(array)/sizeof(array[0]))
@@ -365,6 +365,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
if (uMsg == WM_CREATE)
{
+ g_hWnd = hWnd;
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(((LPCREATESTRUCT)lParam)->lpCreateParams));
DIB_InitOSKeymap();
g_uQueryCancelAutoPlay = RegisterWindowMessage(TEXT("QueryCancelAutoPlay"));
diff --git a/xbmc/windowing/windows/WinSystemWin32.cpp b/xbmc/windowing/windows/WinSystemWin32.cpp
index 9051bc8..4d45086 100644
--- a/xbmc/windowing/windows/WinSystemWin32.cpp
+++ b/xbmc/windowing/windows/WinSystemWin32.cpp
@@ -30,8 +30,6 @@
#ifdef _WIN32
#include <tpcshrd.h>
-HWND g_hWnd = NULL;
-
CWinSystemWin32::CWinSystemWin32()
: CWinSystemBase()
{
@@ -120,7 +118,6 @@ bool CWinSystemWin32::CreateNewWindow(const CStdString& name, bool fullScreen, R
PtrCloseGestureInfoHandle = (pCloseGestureInfoHandle) GetProcAddress( GetModuleHandle( TEXT( "user32" ) ), "CloseGestureInfoHandle" );
m_hWnd = hWnd;
- g_hWnd = hWnd;
m_hDC = GetDC(m_hWnd);
m_bWindowCreated = true;
@@ -670,8 +667,8 @@ bool CWinSystemWin32::Show(bool raise)
UpdateWindow(m_hWnd);
if (raise)
{
- SetForegroundWindow(g_hWnd);
- SetFocus(g_hWnd);
+ SetForegroundWindow(m_hWnd);
+ SetFocus(m_hWnd);
}
return true;
}
https://github.com/xbmc/xbmc/commit/6dfcbc9f926e745bf902f7a8bfd2335e287346b7
commit 6dfcbc9f926e745bf902f7a8bfd2335e287346b7
Author: Glenn Maynard <glenn@...>
Date: Sun Aug 5 19:18:26 2012 -0400
Fix XBMC not fully exiting when Alt-F4 is pressed during video playback.
Fixes #13177.
The following was happening:
- Pressing Alt-F4 triggers WM_CLOSE and then WM_DESTROY. g_hWnd is no longer
valid after WM_DESTROY, but is still set.
- AESinkDirectSound changes format, due to the video being stopped.
CAESinkDirectSound::Initialize's m_pDSound->SetCooperativeLevel call silently
fails: it returns success but doesn't actually do anything. This is triggered
by us passing in the now-invalid g_hWnd. (Not returning an error may be a
DirectSound bug.)
- CAESinkDirectSound::CheckPlayStatus attempts to start playback, and fails
with DSERR_PRIOLEVELNEEDED. This is a silent failure; the result wasn't being
checked or logged.
- CAESinkDirectSound::AddPackets gets stuck in the while(GetSpace() < total)
loop, because the buffer isn't actually playing.
- CAEFactory::Shutdown never returns, because the sink never shuts down.
To fix this, ensure that g_hWnd is cleared on WM_DESTROY, so we don't pass in
bogus values to SetCooperativeLevel. This can't be done in
CWinSystemWin32::DestroyWindowSystem, since it happens too late. Do it in
the event handler, so it's cleared as soon as it's invalidated.
diff --git a/xbmc/windowing/windows/WinEventsWin32.cpp b/xbmc/windowing/windows/WinEventsWin32.cpp
index deeba6a..92e3606 100644
--- a/xbmc/windowing/windows/WinEventsWin32.cpp
+++ b/xbmc/windowing/windows/WinEventsWin32.cpp
@@ -48,6 +48,8 @@
using namespace PERIPHERALS;
+extern HWND g_hWnd;
+
#define XBMC_arraysize(array) (sizeof(array)/sizeof(array[0]))
/* Masks for processing the windows KEYDOWN and KEYUP messages */
@@ -374,6 +376,9 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
return 0;
}
+ if (uMsg == WM_DESTROY)
+ g_hWnd = NULL;
+
m_pEventFunc = (PHANDLE_EVENT_FUNC)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (!m_pEventFunc)
return DefWindowProc(hWnd, uMsg, wParam, lParam);
-----------------------------------------------------------------------
Summary of changes:
xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp | 3 ++-
xbmc/windowing/windows/WinEventsWin32.cpp | 6 ++++++
xbmc/windowing/windows/WinSystemWin32.cpp | 7 ++-----
3 files changed, 10 insertions(+), 6 deletions(-)
hooks/post-receive
--
[xbmc/xbmc]
|