From f3ebbc0ac81967b5ef42414ffd753905075940dd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 17 Jan 2006 04:20:56 +0000 Subject: [PATCH] Remove the busy-wait loops in wxAMMediaBackend::Play as they didn't work right anyway... Also silence some log messages when a failure is expected from wxCheckWindowWndProc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/mediactrl.cpp | 36 ++++++++---------------------------- src/msw/ole/activex.cpp | 5 ++++- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/src/msw/mediactrl.cpp b/src/msw/mediactrl.cpp index 7c2e511cfd..7384442f50 100644 --- a/src/msw/mediactrl.cpp +++ b/src/msw/mediactrl.cpp @@ -1612,7 +1612,10 @@ wxAMMediaBackend::~wxAMMediaBackend() if(m_pAX) { - m_pAX->DissociateHandle(); + { + wxLogNull noLog; + m_pAX->DissociateHandle(); + } delete m_pAX; m_pAM->Release(); @@ -1629,7 +1632,10 @@ wxAMMediaBackend::~wxAMMediaBackend() void wxAMMediaBackend::Clear() { if(m_pTimer) + { delete m_pTimer; + m_pTimer = NULL; + } } //--------------------------------------------------------------------------- @@ -1870,33 +1876,7 @@ bool wxAMMediaBackend::ShowPlayerControls(wxMediaCtrlPlayerControls flags) //--------------------------------------------------------------------------- bool wxAMMediaBackend::Play() { - // if the movie isn't done loading yet - // go into an sync getmessage loop until it is :) - if(m_pMP) - { - MPReadyStateConstants nState; - m_pMP->get_ReadyState(&nState); - while(nState == mpReadyStateLoading && wxYieldIfNeeded()) - { - m_pMP->get_ReadyState(&nState); - } - } - else - { - IActiveMovie2* pAM2; - ReadyStateConstants nState; - if(m_pAM->QueryInterface(IID_IActiveMovie2, (void**)&pAM2) == 0 && - pAM2->get_ReadyState(&nState) == 0) - { - while(nState == amvLoading && wxYieldIfNeeded()) - { - pAM2->get_ReadyState(&nState); - } - pAM2->Release(); - } - } - - //Actually try to play the movie + // Actually try to play the movie, even though it may not be loaded yet. HRESULT hr = m_pAM->Run(); if(SUCCEEDED(hr)) { diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index bddc57e3a9..991e7c9870 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -711,7 +711,10 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) ::SetActiveWindow(m_oleObjectHWND); ::ShowWindow(m_oleObjectHWND, SW_SHOW); - this->AssociateHandle(m_oleObjectHWND); + { + wxLogNull noLog; + this->AssociateHandle(m_oleObjectHWND); + } this->Reparent(m_realparent); wxWindow* pWnd = m_realparent;