Skip to content

Commit

Permalink
Refs #10490. At least a partial LiveTV startup fix.
Browse files Browse the repository at this point in the history
When we call FinishedRecording() early it appears to cause an extra empty
file to be generated at least some of the time. I'm not exactly sure how
this happens, but calling FinishedRecording before the recording is finished
is actually a bug itself. This fixes this in the case where I was able to

reproduce the problem Peter Townsend experienced. I also tried some other
LiveTV actions without seeing duplicate FinishedRecordings calls, but I
may have missed some code paths.
  • Loading branch information
daniel-kristjansson committed Mar 30, 2012
1 parent 7d1cd5f commit 84bc800
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions mythtv/libs/libmythtv/tv_rec.cpp
Expand Up @@ -4437,14 +4437,7 @@ bool TVRec::SwitchLiveTVRingBuffer(const QString & channum,
return false;
}

ProgramInfo *pi = tvchain->GetProgramAt(-1);
if (pi)
{
RecordingInfo *oldinfo = new RecordingInfo(*pi);
delete pi;
FinishedRecording(oldinfo, NULL);
delete oldinfo;
}
QString oldcardtype = tvchain->GetCardType(-1);

pginfo->MarkAsInUse(true, kRecorderInUseID);
pginfo->SaveAutoExpire(kLiveTVAutoExpire);
Expand All @@ -4462,8 +4455,11 @@ bool TVRec::SwitchLiveTVRingBuffer(const QString & channum,
}
else if (!set_rec)
{
if (curRecording)
// dummy recordings are finished before this
// is called and other recordings must be finished..
if (curRecording && oldcardtype != "DUMMY")
{
FinishedRecording(curRecording, NULL);
curRecording->MarkAsInUse(false, kRecorderInUseID);
delete curRecording;
}
Expand Down

0 comments on commit 84bc800

Please sign in to comment.