Ticket #11442: dtvrecorder-debug.patch

File dtvrecorder-debug.patch, 3.2 KB (added by jpoet, 11 years ago)

Add debugging to dtvrecorder

  • mythtv/libs/libmythtv/dtvrecorder.cpp

    diff --git a/mythtv/libs/libmythtv/dtvrecorder.cpp b/mythtv/libs/libmythtv/dtvrecorder.cpp
    index b49fe6d..a537bae 100644
    a b bool DTVRecorder::FindMPEG2Keyframes(const TSPacket* tspacket) 
    550550            /* Found a frame that is not a keyframe, and we want to
    551551             * start on a keyframe */
    552552            _payload_buffer.clear();
     553            LOG(VB_GENERAL, LOG_INFO, LOC +
     554                QString("FindMPEG2Keyframes reset buffer"));
    553555        }
    554556    }
    555557
    bool DTVRecorder::FindAudioKeyframes(const TSPacket*) 
    658660    while (_frames_seen_count > expected_frame + 10000)
    659661        expected_frame += (uint64_t) ((double)msec_per_day / frame_interval);
    660662
     663    LOG(VB_GENERAL, LOG_INFO, LOC +
     664        QString("FindAudioKeyframes _frames_seen_count(%1) expected_frame(%2)")
     665        .arg(_frames_seen_count).arg(expected_frame));
     666
    661667    if (!_frames_seen_count || (_frames_seen_count < expected_frame))
    662668    {
    663669        if (!_frames_seen_count)
    void DTVRecorder::HandleKeyframe(int64_t extra) 
    737743    if (!ringBuffer)
    738744        return;
    739745
     746    LOG(VB_GENERAL, LOG_INFO, LOC +
     747        QString("HandleKeyframe(%2)").arg(extra));
     748
    740749    // Perform ringbuffer switch if needed.
    741750    CheckForRingBufferSwitch();
    742751
    bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket) 
    917926            /* Found a frame that is not a keyframe, and we want to
    918927             * start on a keyframe */
    919928            _payload_buffer.clear();
     929            LOG(VB_GENERAL, LOG_INFO, LOC +
     930                QString("FindH264Keyframes reset buffer"));
    920931        }
    921932    }
    922933
    bool DTVRecorder::ProcessTSPacket(const TSPacket &tspacket) 
    12891300                .arg(erate));
    12901301    }
    12911302
     1303    LOG(VB_GENERAL, LOG_INFO, LOC +
     1304        QString("ProcessTSPacket: _input_pmt(%1) _has_no_av(%2) "
     1305                "_wait_for_keyframe_option(%3) _first_keyframe(%4)")
     1306        .arg(_input_pmt ? 1 : 0).arg(_has_no_av)
     1307        .arg(_wait_for_keyframe_option).arg(_first_keyframe));;
     1308
    12921309    // Only create fake keyframe[s] if there are no audio/video streams
    12931310    if (_input_pmt && _has_no_av)
    12941311    {
    bool DTVRecorder::ProcessVideoTSPacket(const TSPacket &tspacket) 
    13211338    {
    13221339        // buffer packets until we know if this is a keyframe
    13231340        _buffer_packets = true;
     1341        LOG(VB_GENERAL, LOG_INFO, LOC + "ProcessVideoTSPacket payload start");
    13241342    }
    13251343
    13261344    // Check for keyframes and count frames
    13271345    if (streamType == StreamID::H264Video)
     1346    {
     1347        LOG(VB_GENERAL, LOG_INFO, LOC + "ProcessVideoTSPacket H264");
    13281348        FindH264Keyframes(&tspacket);
     1349    }
    13291350    else if (streamType != 0)
     1351    {
     1352        LOG(VB_GENERAL, LOG_INFO, LOC + "ProcessVideoTSPacket MPEG2");
    13301353        FindMPEG2Keyframes(&tspacket);
     1354    }
    13311355    else
    13321356        LOG(VB_RECORD, LOG_ERR, LOC +
    13331357            "ProcessVideoTSPacket: unknown stream type!");
    bool DTVRecorder::ProcessAudioTSPacket(const TSPacket &tspacket) 
    13441368    {
    13451369        // buffer packets until we know if this is a keyframe
    13461370        _buffer_packets = true;
     1371        LOG(VB_GENERAL, LOG_INFO, LOC + "ProcessAudioTSPacket payload start");
    13471372    }
    13481373
    13491374    FindAudioKeyframes(&tspacket);