Skip to content

Commit

Permalink
Fix a possible reace condition when a recording finishes.
Browse files Browse the repository at this point in the history
There was a slight, albeit very unlikely, possibility the scheduler
could run before the recorded table was updated.  This avoids it by
updating the database before notifying the scheduler.

Refs #11224
  • Loading branch information
gigem committed Nov 13, 2012
1 parent 6a147ec commit 729e3d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/tv_rec.cpp
Expand Up @@ -918,6 +918,9 @@ void TVRec::FinishedRecording(RecordingInfo *curRec, RecordingQuality *recq)
PreviewGeneratorQueue::GetPreviewImage(*curRec, "");
}

// store recording in recorded table
curRec->FinishedRecording(!is_good || (recgrp == "LiveTV"));

// send out UPDATE_RECORDING_STATUS message
if (recgrp != "LiveTV")
{
Expand All @@ -930,9 +933,6 @@ void TVRec::FinishedRecording(RecordingInfo *curRec, RecordingQuality *recq)
gCoreContext->dispatch(me);
}

// store recording in recorded table
curRec->FinishedRecording(!is_good || (recgrp == "LiveTV"));

// send out REC_FINISHED message
SendMythSystemRecEvent("REC_FINISHED", curRec);

Expand Down

0 comments on commit 729e3d5

Please sign in to comment.