Ticket #1088: mpegrec_gopbyframe.diff

File mpegrec_gopbyframe.diff, 1.5 KB (added by maverik044, 17 years ago)
  • libs/libmythtv/mpegrecorder.cpp

    old new void MpegRecorder::Reset(void) 
    10211021    buildbuffersize = 0;
    10221022
    10231023    if (curRecording)
    1024         curRecording->ClearPositionMap(MARK_GOP_START);
     1024        curRecording->ClearPositionMap(MARK_GOP_BYFRAME);
    10251025}
    10261026
    10271027void MpegRecorder::Pause(bool clear)
    void MpegRecorder::SetNextRecording(cons 
    10651065 */
    10661066void MpegRecorder::HandleKeyframe(void)
    10671067{
     1068    long long frameNum = framesWritten;
     1069   
    10681070    // Add key frame to position map
    10691071    bool save_map = false;
    10701072    positionMapLock.lock();
    1071     if (!positionMap.contains(numgops))
     1073    if (!positionMap.contains(frameNum))
    10721074    {
    1073         positionMapDelta[numgops] = lastpackheaderpos;
    1074         positionMap[numgops]      = lastpackheaderpos;
     1075        positionMapDelta[frameNum] = lastpackheaderpos;
     1076        positionMap[frameNum]      = lastpackheaderpos;
    10751077        save_map = true;
    10761078    }
    10771079    positionMapLock.unlock();
    void MpegRecorder::SavePositionMap(bool  
    11021104    if (curRecording && force)
    11031105    {
    11041106        curRecording->SetPositionMapDelta(positionMapDelta,
    1105                                           MARK_GOP_START);
     1107                                          MARK_GOP_BYFRAME);
    11061108        // Stop setting the filesize here until we get the contention issue
    11071109        // between with this thread and the scheduler worked out.
    11081110        //curRecording->SetFilesize(lastpackheaderpos);