Ticket #1153: 1153-v2.patch

File 1153-v2.patch, 3.1 KB (added by danielk, 19 years ago)

Possible fix for problem

  • libs/libmythtv/tv_rec.cpp

     
    125125      internalState(kState_None), desiredNextState(kState_None),
    126126      changeState(false), pauseNotify(true),
    127127      stateFlags(0), lastTuningRequest(0),
     128      // Previous recording info
     129      lastRecording(NULL),
    128130      // Current recording info
    129131      curRecording(NULL), autoRunJobs(JOB_NONE),
    130132      // Pending recording info
     
    12681270        // Check for the end of the current program..
    12691271        if (GetState() == kState_WatchingLiveTV)
    12701272        {
    1271 #define LIVETV_END (now >= curRecording->endts)
    1272 // use the following instead to test ringbuffer switching
    1273 //static QDateTime last = QDateTime::currentDateTime();
    1274 //#define LIVETV_END ((now >= curRecording->recstartts.addSecs(20)) && (now > last))
    1275 
    12761273            QDateTime now   = QDateTime::currentDateTime();
    12771274            bool has_finish = HasFlags(kFlagFinishRecording);
    12781275            bool has_rec    = pseudoLiveTVRecording;
     
    13001297
    13011298                SetPseudoLiveTVRecording(NULL);
    13021299            }
    1303             else if (!has_rec && !rec_soon && curRecording && LIVETV_END)
     1300            else if (!has_rec && !rec_soon && curRecording &&
     1301                     (now >= curRecording->endts))
    13041302            {
    1305                 SwitchLiveTVRingBuffer();
     1303                if (lastRecording != curRecording)
     1304                {
     1305                    lastRecording = curRecording;
    13061306
    1307                 QDateTime starttime; starttime.setTime_t(0);
    1308                 if (curRecording)
    1309                     starttime = curRecording->recstartts;
    1310                 VERBOSE(VB_RECORD, LOC
    1311                         <<"!has_rec("<<!has_rec<<") "
    1312                         <<"!rec_soon("<<!rec_soon<<") "
    1313                         <<"curRec("<<curRecording<<") "
    1314                         <<"starttm("<<starttime.toString(Qt::ISODate)<<")");
    1315 //                last = QDateTime::currentDateTime().addSecs(20);
     1307                    SwitchLiveTVRingBuffer(false, true);
     1308
     1309                    QDateTime starttime; starttime.setTime_t(0);
     1310                    if (curRecording)
     1311                        starttime = curRecording->recstartts;
     1312
     1313                    VERBOSE(VB_RECORD, LOC
     1314                            <<"!has_rec("<<!has_rec<<") "
     1315                            <<"!rec_soon("<<!rec_soon<<") "
     1316                            <<"curRec("<<curRecording<<") "
     1317                            <<"starttm("
     1318                            <<starttime.toString(Qt::ISODate)<<")");
     1319                }
    13161320            }
    13171321            else
    13181322                enable_ui = false;
  • libs/libmythtv/tv_rec.h

     
    351351    QWaitCondition triggerEventLoop;
    352352    QWaitCondition triggerEventSleep;
    353353
     354    // Previous recording pointer (do not dereference)
     355    ProgramInfo *lastRecording;
     356
    354357    // Current recording info
    355358    ProgramInfo *curRecording;
    356359    QDateTime    recordEndTime;