Ticket #3963: 3963-v1.patch

File 3963-v1.patch, 2.5 KB (added by danielk, 17 years ago)

Patch based on Shane's mythtv_multirec_dvbrec_ResetForNewFile.diff

  • libs/libmythtv/dvbrecorder.cpp

     
    423423    _recording = false;
    424424}
    425425
    426 void DVBRecorder::Reset(void)
     426void DVBRecorder::ResetForNewFile(void)
    427427{
    428     DTVRecorder::Reset();
     428    DTVRecorder::ResetForNewFile();
    429429
    430430    bzero(_stream_id,  sizeof(_stream_id));
    431431    bzero(_pid_status, sizeof(_pid_status));
    432432    memset(_continuity_counter, 0xff, sizeof(_continuity_counter));
    433 
    434     if (curRecording)
    435     {
    436         curRecording->ClearPositionMap(MARK_GOP_BYFRAME);
    437     }
    438433}
    439434
    440435void DVBRecorder::StopRecording(void)
  • libs/libmythtv/dvbrecorder.h

     
    5757                               const QString &vbidev);
    5858
    5959    void StartRecording(void);
    60     void Reset(void);
     60    void ResetForNewFile(void);
    6161    void StopRecording(void);
    6262
    6363    bool Open(void);
  • libs/libmythtv/dtvrecorder.cpp

     
    132132    return ret;
    133133}
    134134
    135 // documented in recorderbase.h
    136 void DTVRecorder::Reset(void)
     135void DTVRecorder::ResetForNewFile(void)
    137136{
     137    VERBOSE(VB_RECORD, LOC + "ResetForNewFile(void)");
    138138    QMutexLocker locker(&positionMapLock);
    139139
    140     _start_code                 = 0xffffffff;
     140    //_start_code
    141141    _first_keyframe             =-1;
    142142    _last_keyframe_seen         = 0;
    143143    _last_gop_seen              = 0;
     
    155155    positionMapDelta.clear();
    156156}
    157157
     158// documented in recorderbase.h
     159void DTVRecorder::Reset(void)
     160{
     161    VERBOSE(VB_RECORD, LOC + "Reset(void)");
     162    ResetForNewFile();
     163
     164    _start_code = 0xffffffff;
     165
     166    if (curRecording)
     167        curRecording->ClearPositionMap(MARK_GOP_BYFRAME);
     168}
     169
    158170void DTVRecorder::BufferedWrite(const TSPacket &tspacket)
    159171{
    160172    // delay until first GOP to avoid decoder crash on res change
     
    348360    nextRingBufferLock.unlock();
    349361}
    350362
    351 void DTVRecorder::ResetForNewFile(void)
    352 {
    353     VERBOSE(VB_RECORD, LOC + "ResetForNewFile(void)");
    354     Reset();
    355 }
    356 
    357363/** \fn DTVRecorder::HandleKeyframe(void)
    358364 *  \brief This save the current frame to the position maps
    359365 *         and handles ringbuffer switching.