Skip to content

Commit

Permalink
Flip the ALLOWLASTPLAYPOS flag to become the IGNORELASTPLAYPOS flag.
Browse files Browse the repository at this point in the history
This brings the flag into line with the other IGNORExxx flags. Given
that the last play position is never set, this change should have no
effect on the code.
  • Loading branch information
linuxdude42 committed Jan 14, 2022
1 parent 8aa1468 commit 7cd9a3c
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/programinfo.cpp
Expand Up @@ -2796,7 +2796,7 @@ uint64_t ProgramInfo::QueryProgStart(void) const
*/
uint64_t ProgramInfo::QueryLastPlayPos(void) const
{
if (!(m_programFlags & FL_ALLOWLASTPLAYPOS))
if (m_programFlags & FL_IGNORELASTPLAYPOS)
return 0;

frm_dir_map_t bookmarkmap;
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmyth/programinfo.h
Expand Up @@ -571,10 +571,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 SetAllowLastPlayPos(bool allow)
void SetIgnoreLastPlayPos(bool ignore)
{
m_programFlags &= ~FL_ALLOWLASTPLAYPOS;
m_programFlags |= (allow) ? FL_ALLOWLASTPLAYPOS : 0;
m_programFlags &= ~FL_IGNORELASTPLAYPOS;
m_programFlags |= (ignore) ? FL_IGNORELASTPLAYPOS : 0;
}
virtual void SetRecordingID(uint _recordedid)
{ m_recordedId = _recordedid; }
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/programtypeflags.h
Expand Up @@ -53,7 +53,7 @@ FLAGS_DATA(FL, DUPLICATE, 0x00002000)
FLAGS_DATA(FL, REACTIVATE, 0x00004000)
FLAGS_DATA(FL, IGNOREBOOKMARK, 0x00008000)
FLAGS_DATA(FL, IGNOREPROGSTART, 0x00010000)
FLAGS_DATA(FL, ALLOWLASTPLAYPOS, 0x00020000)
FLAGS_DATA(FL, IGNORELASTPLAYPOS,0x00020000)
// if you move the type mask please edit {Set,Get}ProgramInfoType()
FLAGS_DATA(FL, TYPEMASK, 0x00F00000)
FLAGS_DATA(FL, INUSERECORDING, 0x01000000)
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/test/test_programinfo/test_programinfo.h
Expand Up @@ -159,7 +159,7 @@ class TestProgramInfo : public QObject
{"parttotal", "133"},
{"playgroup", "Default"},
{"programflags", "131600"},
{"programflags_names", "BOOKMARK|WATCHED|ALLOWLASTPLAYPOS"},
{"programflags_names", "BOOKMARK|WATCHED|IGNORELASTPLAYPOS"},
{"programid", "EP019229360055"},
{"recenddate", "Wed 26"},
{"recendtime", "1:02 AM"},
Expand Down Expand Up @@ -327,7 +327,7 @@ class TestProgramInfo : public QObject
RecStatus::Unknown, 19890314, // recordid
kDupsInAll, kDupCheckSubThenDesc,
20141007, // findId
FL_ALLOWLASTPLAYPOS | FL_WATCHED | FL_BOOKMARK,
FL_IGNORELASTPLAYPOS | FL_WATCHED | FL_BOOKMARK,
AUD_DOLBY,
VID_DAMAGED | VID_1080 | VID_HDTV,
SUB_HARDHEAR,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mythplayerui.cpp
Expand Up @@ -467,7 +467,7 @@ void MythPlayerUI::EventStart()
// an actual bookmark and not progstart or lastplaypos information.
m_playerCtx->m_playingInfo->SetIgnoreBookmark(false);
m_playerCtx->m_playingInfo->SetIgnoreProgStart(true);
m_playerCtx->m_playingInfo->SetAllowLastPlayPos(false);
m_playerCtx->m_playingInfo->SetIgnoreLastPlayPos(true);
}
}
m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/previewgenerator.cpp
Expand Up @@ -634,7 +634,7 @@ bool PreviewGenerator::LocalPreviewRun(void)
{
m_programInfo.MarkAsInUse(true, kPreviewGeneratorInUseID);
m_programInfo.SetIgnoreProgStart(true);
m_programInfo.SetAllowLastPlayPos(false);
m_programInfo.SetIgnoreLastPlayPos(true);

float aspect = 0;
std::chrono::seconds captime = m_captureTime;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -286,7 +286,7 @@ bool TV::StartTV(ProgramInfo* TVRec, uint Flags, const ChannelInfoList& Selectio
curProgram = new ProgramInfo(*TVRec);
curProgram->SetIgnoreBookmark((Flags & kStartTVIgnoreBookmark) != 0U);
curProgram->SetIgnoreProgStart((Flags & kStartTVIgnoreProgStart) != 0U);
curProgram->SetAllowLastPlayPos((Flags & kStartTVAllowLastPlayPos) != 0U);
curProgram->SetIgnoreLastPlayPos((Flags & kStartTVIgnoreLastPlayPos) != 0U);
}

// Initialize TV
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/tv_play.h
Expand Up @@ -109,12 +109,12 @@ enum NoRecorderMsg
};

enum {
kStartTVNoFlags = 0x00,
kStartTVInPlayList = 0x02,
kStartTVByNetworkCommand = 0x04,
kStartTVIgnoreBookmark = 0x08,
kStartTVIgnoreProgStart = 0x10,
kStartTVAllowLastPlayPos = 0x20,
kStartTVNoFlags = 0x00,
kStartTVInPlayList = 0x02,
kStartTVByNetworkCommand = 0x04,
kStartTVIgnoreBookmark = 0x08,
kStartTVIgnoreProgStart = 0x10,
kStartTVIgnoreLastPlayPos = 0x20,
};

class AskProgramInfo
Expand Down
10 changes: 5 additions & 5 deletions mythtv/programs/mythfrontend/playbackbox.cpp
Expand Up @@ -2576,11 +2576,11 @@ bool PlaybackBox::Play(
ignoreProgStart = true;

uint flags =
(inPlaylist ? kStartTVInPlayList : kStartTVNoFlags) |
(underNetworkControl ? kStartTVByNetworkCommand : kStartTVNoFlags) |
(!ignoreLastPlayPos ? kStartTVAllowLastPlayPos : kStartTVNoFlags) |
(ignoreProgStart ? kStartTVIgnoreProgStart : kStartTVNoFlags) |
(ignoreBookmark ? kStartTVIgnoreBookmark : kStartTVNoFlags);
(inPlaylist ? kStartTVInPlayList : kStartTVNoFlags) |
(underNetworkControl ? kStartTVByNetworkCommand : kStartTVNoFlags) |
(ignoreLastPlayPos ? kStartTVIgnoreLastPlayPos : kStartTVNoFlags) |
(ignoreProgStart ? kStartTVIgnoreProgStart : kStartTVNoFlags) |
(ignoreBookmark ? kStartTVIgnoreBookmark : kStartTVNoFlags);

playCompleted = TV::StartTV(&tvrec, flags);

Expand Down

0 comments on commit 7cd9a3c

Please sign in to comment.