Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix minor problems editing in-progress recordings.

Revert 5d7c01d, and add logic that also updates the edit bar when
the total number of frames in the recording changes.

Modify 1ce3d21 to use a better test for an in-progress recording.
If the recording finishes during the editing session, the original
test would continue to indicate that the recording was in-progress.

Binary version is updated.  Refs #10329.
  • Loading branch information...
commit f77d001e945387ecb00fd88c53b45bb74ae0f396 1 parent 006ded1
@stichnot stichnot authored
View
2  mythtv/libs/libmythbase/mythversion.h
@@ -12,7 +12,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
-#define MYTH_BINARY_VERSION "0.25.20120225-1"
+#define MYTH_BINARY_VERSION "0.25.20120225-2"
/** \brief Increment this whenever the MythTV network protocol changes.
*
View
6 mythtv/libs/libmythtv/deletemap.cpp
@@ -5,6 +5,7 @@
#include "mythcontext.h"
#include "osd.h"
#include "deletemap.h"
+#include "mythplayer.h"
#define LOC QString("DelMap: ")
#define EDIT_CHECK do { \
@@ -92,7 +93,7 @@ bool DeleteMap::HandleAction(QString &action, uint64_t frame,
Add(frame, total, MARK_CUT_START, QObject::tr("Cut to End"));
// If the recording is still in progress, add an explicit end
// mark at the end.
- if (m_ctx->playingInfo->GetRecordingStatus() == rsRecording)
+ if (m_ctx->player && m_ctx->player->IsWatchingInprogress())
Add(total - 1, total, MARK_CUT_END, "");
}
else if (action == "NEWCUT")
@@ -172,9 +173,10 @@ void DeleteMap::UpdateOSD(uint64_t frame, uint64_t total, double frame_rate,
posMap.insert("position", (float)((double)frame/(double)total));
osd->SetValues("osd_program_editor", posMap, kOSDTimeout_None);
osd->SetText("osd_program_editor", infoMap, kOSDTimeout_None);
- //if (m_changed)
+ if (m_changed || total != m_cachedTotalForOSD)
osd->SetRegions("osd_program_editor", m_deleteMap, total);
m_changed = false;
+ m_cachedTotalForOSD = total;
}
/// Set the edit mode and optionally hide the edit mode OSD.
View
6 mythtv/libs/libmythtv/deletemap.h
@@ -23,7 +23,10 @@ class MTV_PUBLIC DeleteMap
m_nextCutStartIsValid(false),
m_nextCutStart(0), m_changed(true),
m_seekamountpos(4), m_seekamount(30),
- m_ctx(0), m_undoStackPointer(-1) { Push(""); }
+ m_ctx(0), m_cachedTotalForOSD(0), m_undoStackPointer(-1)
+ {
+ Push("");
+ }
void SetPlayerContext(PlayerContext *ctx) { m_ctx = ctx; }
bool HandleAction(QString &action, uint64_t frame, uint64_t played,
@@ -90,6 +93,7 @@ class MTV_PUBLIC DeleteMap
int m_seekamountpos;
int m_seekamount;
PlayerContext *m_ctx;
+ uint64_t m_cachedTotalForOSD;
// Invariant: m_undoStack[m_undoStackPointer].deleteMap == m_deleteMap
QVector<DeleteMapUndoEntry> m_undoStack;
View
28 mythtv/libs/libmythtv/mythplayer.cpp
@@ -310,6 +310,12 @@ void MythPlayer::SetWatchingRecording(bool mode)
decoder->setWatchingRecording(mode);
}
+bool MythPlayer::IsWatchingInprogress(void) const
+{
+ return watchingrecording && player_ctx->recorder &&
+ player_ctx->recorder->IsValidRecorder();
+}
+
void MythPlayer::PauseBuffer(void)
{
bufferPauseLock.lock();
@@ -2692,8 +2698,7 @@ void MythPlayer::EventLoop(void)
SetScanType(resetScan);
// refresh the position map for an in-progress recording while editing
- if (hasFullPositionMap && watchingrecording && player_ctx->recorder &&
- player_ctx->recorder->IsValidRecorder() && deleteMap.IsEditing())
+ if (hasFullPositionMap && IsWatchingInprogress() && deleteMap.IsEditing())
{
if (editUpdateTimer.elapsed() > 2000)
{
@@ -3470,8 +3475,7 @@ long long MythPlayer::CalcMaxFFTime(long long ff, bool setjump) const
bool islivetvcur = (livetv && player_ctx->tvchain &&
!player_ctx->tvchain->HasNext());
- if (livetv || (watchingrecording && player_ctx->recorder &&
- player_ctx->recorder->IsValidRecorder()))
+ if (livetv || IsWatchingInprogress())
maxtime = (long long)(3.0 * video_frame_rate);
long long ret = ff;
@@ -3491,8 +3495,7 @@ long long MythPlayer::CalcMaxFFTime(long long ff, bool setjump) const
}
}
}
- else if (islivetvcur || (watchingrecording && player_ctx->recorder &&
- player_ctx->recorder->IsValidRecorder()))
+ else if (islivetvcur || IsWatchingInprogress())
{
long long behind = player_ctx->recorder->GetFramesWritten() -
framesPlayed;
@@ -3555,8 +3558,7 @@ bool MythPlayer::IsNearEnd(void)
long long margin = (long long)(video_frame_rate * 2);
margin = (long long) (margin * audio.GetStretchFactor());
- bool watchingTV = watchingrecording && player_ctx->recorder &&
- player_ctx->recorder->IsValidRecorder();
+ bool watchingTV = IsWatchingInprogress();
framesRead = decoder->GetFramesRead();
@@ -3634,8 +3636,7 @@ void MythPlayer::WaitForSeek(uint64_t frame, bool override_seeks,
!player_ctx->tvchain->HasNext());
uint64_t max = totalFrames;
- if ((islivetvcur || (watchingrecording && player_ctx->recorder &&
- player_ctx->recorder->IsValidRecorder())))
+ if (islivetvcur || IsWatchingInprogress())
{
max = (uint64_t)player_ctx->recorder->GetFramesWritten();
}
@@ -4487,9 +4488,7 @@ int MythPlayer::GetStatusbarPos(void) const
{
double spos = 0.0;
- if ((livetv) ||
- (watchingrecording && player_ctx->recorder &&
- player_ctx->recorder->IsValidRecorder()))
+ if (livetv || IsWatchingInprogress())
{
spos = 1000.0 * framesPlayed / player_ctx->recorder->GetFramesWritten();
}
@@ -4590,8 +4589,7 @@ void MythPlayer::calcSliderPos(osdInfo &info, bool paddedFields)
playbackLen = player_ctx->tvchain->GetLengthAtCurPos();
islive = true;
}
- else if (watchingrecording && player_ctx->recorder &&
- player_ctx->recorder->IsValidRecorder())
+ else if (IsWatchingInprogress())
{
playbackLen =
(int)(((float)player_ctx->recorder->GetFramesWritten() /
View
1  mythtv/libs/libmythtv/mythplayer.h
@@ -215,6 +215,7 @@ class MTV_PUBLIC MythPlayer
bool HasTVChainNext(void) const;
bool CanSupportDoubleRate(void);
bool GetScreenShot(int width = 0, int height = 0, QString filename = "");
+ bool IsWatchingInprogress(void) const;
// Non-const gets
virtual char *GetScreenGrabAtFrame(uint64_t frameNum, bool absolute,
Please sign in to comment.
Something went wrong with that request. Please try again.