Skip to content

Commit

Permalink
Merge pull request #12985 from FernetMenta/lambda
Browse files Browse the repository at this point in the history
VideoPlayer: lambda jobs must copy parameters
  • Loading branch information
FernetMenta committed Nov 1, 2017
2 parents f2bc3ac + 3a4e179 commit 00ffd3d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions xbmc/cores/VideoPlayer/VideoPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,11 @@ bool CVideoPlayer::CloseFile(bool reopen)
{
CLog::Log(LOGNOTICE, "CVideoPlayer::CloseFile()");

CJobManager::GetInstance().Submit([&]() {
m_callback.StoreVideoSettings(m_item, m_processInfo->GetVideoSettings());
IPlayerCallback *cb = &m_callback;
CFileItem fileItem(m_item);
CVideoSettings vs = m_processInfo->GetVideoSettings();
CJobManager::GetInstance().Submit([=]() {
cb->StoreVideoSettings(fileItem, vs);
}, CJob::PRIORITY_NORMAL);

// set the abort request so that other threads can finish up
Expand Down Expand Up @@ -2502,8 +2505,11 @@ void CVideoPlayer::HandleMessages()
{
CDVDMsgOpenFile &msg(*static_cast<CDVDMsgOpenFile*>(pMsg));

CJobManager::GetInstance().Submit([&]() {
m_callback.StoreVideoSettings(m_item, m_processInfo->GetVideoSettings());
IPlayerCallback *cb = &m_callback;
CFileItem fileItem(m_item);
CVideoSettings vs = m_processInfo->GetVideoSettings();
CJobManager::GetInstance().Submit([=]() {
cb->StoreVideoSettings(fileItem, vs);
}, CJob::PRIORITY_NORMAL);

m_item = msg.GetItem();
Expand Down

0 comments on commit 00ffd3d

Please sign in to comment.