diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 0571c0732..b60aba830 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1243,14 +1243,14 @@ CFile* CMovieBrowser::getSelectedFile(void) return(NULL); } -bool CMovieBrowser::getSelectedFiles(CFileList &flist, MI_MOVIE_LIST &mlist) +bool CMovieBrowser::getSelectedFiles(CFileList &flist, P_MI_MOVIE_LIST &mlist) { flist.clear(); mlist.clear(); - for(unsigned int i = 0; i < m_vMovieInfo.size(); i++) { - if (m_vMovieInfo[i].marked) { - flist.push_back(m_vMovieInfo[i].file); - mlist.push_back(m_vMovieInfo[i]); + for(unsigned int i = 0; i < m_vHandleBrowserList.size(); i++) { + if (m_vHandleBrowserList[i]->marked) { + flist.push_back(m_vHandleBrowserList[i]->file); + mlist.push_back(m_vHandleBrowserList[i]); } } return (!flist.empty()); diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index c22bfbda2..c3456e768 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -338,7 +338,7 @@ class CMovieBrowser : public CMenuTarget int exec(CMenuTarget* parent, const std::string & actionKey); std::string getCurrentDir(void); //P1 for FileBrowser compatibility CFile* getSelectedFile(void); //P1 for FileBrowser compatibility - bool getSelectedFiles(CFileList &flist, MI_MOVIE_LIST &mlist); //P1 for FileBrowser compatibility + bool getSelectedFiles(CFileList &flist, P_MI_MOVIE_LIST &mlist); //P1 for FileBrowser compatibility MI_MOVIE_BOOKMARKS* getCurrentMovieBookmark(void){if(m_movieSelectionHandler == NULL) return NULL; return(&(m_movieSelectionHandler->bookmarks));}; int getCurrentStartPos(void){return(m_currentStartPos);}; //P1 return start position in [s] MI_MOVIE_INFO* getCurrentMovieInfo(void){return(m_movieSelectionHandler);}; //P1 return start position in [s] diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index f67ffa833..8403f058e 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -176,6 +176,7 @@ typedef struct } MI_MOVIE_INFO; typedef std::vector MI_MOVIE_LIST; +typedef std::vector P_MI_MOVIE_LIST; class CMovieInfo { diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 8c60f37b0..92ada2ff8 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -434,7 +434,7 @@ bool CMoviePlayerGui::prepareFile(CFile *file) if (isMovieBrowser) { if (filelist_it != filelist.end()) { unsigned idx = filelist_it - filelist.begin(); - p_movie_info = &milist[idx]; + p_movie_info = milist[idx]; } if (isYT) { file_name = file->Url; @@ -492,7 +492,7 @@ bool CMoviePlayerGui::SelectFile() filelist_it = filelist.end(); if (moviebrowser->getSelectedFiles(filelist, milist)) { filelist_it = filelist.begin(); - p_movie_info = &(*milist.begin()); + p_movie_info = *(milist.begin()); file = &(*filelist_it); } else if ((file = moviebrowser->getSelectedFile()) != NULL) { @@ -690,8 +690,11 @@ bool CMoviePlayerGui::PlayFileStart(void) printf("IS FILE PLAYER: %s\n", is_file_player ? "true": "false" ); if (p_movie_info) { - movie_info = *p_movie_info; - p_movie_info = &movie_info; + if (timeshift != TSHIFT_MODE_OFF) { + // p_movie_info may be invalidated by CRecordManager while we're still using it. Create and use a copy. + movie_info = *p_movie_info; + p_movie_info = &movie_info; + } duration = p_movie_info->length * 60 * 1000; int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, currentapid, currentac3 == 1); diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 5ffba898c..572efce5f 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -115,7 +115,7 @@ class CMoviePlayerGui : public CMenuTarget CMovieBrowser* moviebrowser; MI_MOVIE_INFO * p_movie_info; MI_MOVIE_INFO movie_info; - MI_MOVIE_LIST milist; + P_MI_MOVIE_LIST milist; const static short MOVIE_HINT_BOX_TIMER = 5; // time to show bookmark hints in seconds /* playback from file */