From 38443b8e6a306335d0dabe434ba4e983a62fd056 Mon Sep 17 00:00:00 2001 From: Jim Stichnoth Date: Thu, 23 Apr 2015 20:34:24 -0700 Subject: [PATCH] Turn off LastPlayPos loading by default. Refs #11713. In the way things were set up originally, by default any playback would check for bookmark, progstart mark, or lastplaypos mark, and start playback from there, unless any or all of these had been explicitly disallowed. This was fine for playback from the Watch Recordings screen, which would always explicitly set each permission. It was not so good for other forms of playback, such as from MythVideo, mythavtest, or Gallery, since they would all favor lastplaypos, which is periodically updated for all playback. As a result, lastplaypos is changed to be disallowed by default. This is not really relevant to the progstart mark, since it is only present for recordings (though it could become a minor issue if a recording and its metadata are imported into MythVideo). --- mythtv/libs/libmyth/programinfo.cpp | 2 +- mythtv/libs/libmyth/programinfo.h | 6 +++--- mythtv/libs/libmyth/programtypes.h | 4 ++-- mythtv/libs/libmythtv/mythplayer.cpp | 2 +- mythtv/libs/libmythtv/previewgenerator.cpp | 2 +- mythtv/libs/libmythtv/tv_play.cpp | 2 +- mythtv/libs/libmythtv/tv_play.h | 2 +- mythtv/programs/mythfrontend/playbackbox.cpp | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mythtv/libs/libmyth/programinfo.cpp b/mythtv/libs/libmyth/programinfo.cpp index 9757c18ffe5..1adec81428e 100644 --- a/mythtv/libs/libmyth/programinfo.cpp +++ b/mythtv/libs/libmyth/programinfo.cpp @@ -2720,7 +2720,7 @@ uint64_t ProgramInfo::QueryProgStart(void) const */ uint64_t ProgramInfo::QueryLastPlayPos(void) const { - if (programflags & FL_IGNORELASTPLAYPOS) + if (!(programflags & FL_ALLOWLASTPLAYPOS)) return 0; frm_dir_map_t bookmarkmap; diff --git a/mythtv/libs/libmyth/programinfo.h b/mythtv/libs/libmyth/programinfo.h index a37ac051842..a058e444619 100644 --- a/mythtv/libs/libmyth/programinfo.h +++ b/mythtv/libs/libmyth/programinfo.h @@ -542,10 +542,10 @@ class MPUBLIC ProgramInfo /// \brief If "ignore" is true QueryLastPlayPos() will return 0, otherwise /// QueryLastPlayPos() will return the last playback position /// if it exists. - void SetIgnoreLastPlayPos(bool ignore) + void SetAllowLastPlayPos(bool allow) { - programflags &= ~FL_IGNORELASTPLAYPOS; - programflags |= (ignore) ? FL_IGNORELASTPLAYPOS : 0; + programflags &= ~FL_ALLOWLASTPLAYPOS; + programflags |= (allow) ? FL_ALLOWLASTPLAYPOS : 0; } virtual void SetRecordingID(uint _recordedid) { recordedid = _recordedid; } void SetRecordingStatus(RecStatus::Type status) { recstatus = status; } diff --git a/mythtv/libs/libmyth/programtypes.h b/mythtv/libs/libmyth/programtypes.h index 373d3adcd20..694b1a6f838 100644 --- a/mythtv/libs/libmyth/programtypes.h +++ b/mythtv/libs/libmyth/programtypes.h @@ -147,8 +147,8 @@ typedef enum FlagMask { FL_DUPLICATE = 0x00002000, FL_REACTIVATE = 0x00004000, FL_IGNOREBOOKMARK = 0x00008000, - FL_IGNOREPROGSTART = 0x00010000, - FL_IGNORELASTPLAYPOS = 0x00020000, + FL_IGNOREPROGSTART = 0x00010000, + FL_ALLOWLASTPLAYPOS = 0x00020000, // if you move the type mask please edit {Set,Get}ProgramInfoType() FL_TYPEMASK = 0x00F00000, FL_INUSERECORDING = 0x01000000, diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp index e89cd778268..77ee50cb706 100644 --- a/mythtv/libs/libmythtv/mythplayer.cpp +++ b/mythtv/libs/libmythtv/mythplayer.cpp @@ -2887,7 +2887,7 @@ void MythPlayer::EventStart(void) // an actual bookmark and not progstart or lastplaypos information. player_ctx->playingInfo->SetIgnoreBookmark(false); player_ctx->playingInfo->SetIgnoreProgStart(true); - player_ctx->playingInfo->SetIgnoreLastPlayPos(true); + player_ctx->playingInfo->SetAllowLastPlayPos(false); } } player_ctx->UnlockPlayingInfo(__FILE__, __LINE__); diff --git a/mythtv/libs/libmythtv/previewgenerator.cpp b/mythtv/libs/libmythtv/previewgenerator.cpp index ef0db2a7930..280526d7c1f 100644 --- a/mythtv/libs/libmythtv/previewgenerator.cpp +++ b/mythtv/libs/libmythtv/previewgenerator.cpp @@ -614,7 +614,7 @@ bool PreviewGenerator::LocalPreviewRun(void) { m_programInfo.MarkAsInUse(true, kPreviewGeneratorInUseID); m_programInfo.SetIgnoreProgStart(true); - m_programInfo.SetIgnoreLastPlayPos(true); + m_programInfo.SetAllowLastPlayPos(false); float aspect = 0; int width, height, sz; diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp index e9752fa5494..146cc248647 100644 --- a/mythtv/libs/libmythtv/tv_play.cpp +++ b/mythtv/libs/libmythtv/tv_play.cpp @@ -343,7 +343,7 @@ bool TV::StartTV(ProgramInfo *tvrec, uint flags, curProgram = new ProgramInfo(*tvrec); curProgram->SetIgnoreBookmark(flags & kStartTVIgnoreBookmark); curProgram->SetIgnoreProgStart(flags & kStartTVIgnoreProgStart); - curProgram->SetIgnoreLastPlayPos(flags & kStartTVIgnoreLastPlayPos); + curProgram->SetAllowLastPlayPos(flags & kStartTVAllowLastPlayPos); } GetMythMainWindow()->PauseIdleTimer(true); diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h index 339aee56d50..6626024da6a 100644 --- a/mythtv/libs/libmythtv/tv_play.h +++ b/mythtv/libs/libmythtv/tv_play.h @@ -116,7 +116,7 @@ enum { kStartTVByNetworkCommand = 0x04, kStartTVIgnoreBookmark = 0x08, kStartTVIgnoreProgStart = 0x10, - kStartTVIgnoreLastPlayPos= 0x20, + kStartTVAllowLastPlayPos = 0x20, }; class AskProgramInfo diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp index 360d457cbb9..6d69ef3471f 100644 --- a/mythtv/programs/mythfrontend/playbackbox.cpp +++ b/mythtv/programs/mythfrontend/playbackbox.cpp @@ -2497,7 +2497,7 @@ bool PlaybackBox::Play( uint flags = (inPlaylist ? kStartTVInPlayList : kStartTVNoFlags) | (underNetworkControl ? kStartTVByNetworkCommand : kStartTVNoFlags) | - (ignoreLastPlayPos ? kStartTVIgnoreLastPlayPos: kStartTVNoFlags) | + (!ignoreLastPlayPos ? kStartTVAllowLastPlayPos : kStartTVNoFlags) | (ignoreProgStart ? kStartTVIgnoreProgStart : kStartTVNoFlags) | (ignoreBookmark ? kStartTVIgnoreBookmark : kStartTVNoFlags);