FIX: [STUDIO-3309] MediaCtrl: Stop before Load({})

Change-Id: Id7c96fdf7fd717725e94b9ae28b261963b8f64e7
This commit is contained in:
chunmao.guo 2023-06-29 13:43:52 +08:00 committed by Lane.Wei
parent a98b781425
commit b50838b155
2 changed files with 8 additions and 2 deletions

View File

@ -488,6 +488,13 @@ void MediaPlayCtrl::media_proc()
m_cond.wait(lock); m_cond.wait(lock);
} }
wxString url = m_tasks.front(); wxString url = m_tasks.front();
if (m_tasks.size() >= 2 && !url.IsEmpty() && url[0] != '<' && m_tasks[1] == "<stop>") {
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: busy skip url" << url;
m_tasks.pop_front();
m_tasks.pop_front();
lock.unlock();
continue;
}
lock.unlock(); lock.unlock();
if (url.IsEmpty()) { if (url.IsEmpty()) {
break; break;

View File

@ -170,10 +170,9 @@ void wxMediaCtrl2::Play() { wxMediaCtrl::Play(); }
void wxMediaCtrl2::Stop() void wxMediaCtrl2::Stop()
{ {
wxMediaCtrl::Stop();
#ifdef __WIN32__ #ifdef __WIN32__
wxMediaCtrl::Load(wxURI()); wxMediaCtrl::Load(wxURI());
#else
wxMediaCtrl::Stop();
#endif #endif
} }