Skip to content

Commit

Permalink
Turn off LastPlayPos loading by default. Refs #11713.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
stichnot committed Apr 24, 2015
1 parent 0925cc0 commit 38443b8
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/programinfo.cpp
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmyth/programinfo.h
Expand Up @@ -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; }
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/programtypes.h
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -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__);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/previewgenerator.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/tv_play.h
Expand Up @@ -116,7 +116,7 @@ enum {
kStartTVByNetworkCommand = 0x04,
kStartTVIgnoreBookmark = 0x08,
kStartTVIgnoreProgStart = 0x10,
kStartTVIgnoreLastPlayPos= 0x20,
kStartTVAllowLastPlayPos = 0x20,
};

class AskProgramInfo
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/playbackbox.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit 38443b8

Please sign in to comment.