Ticket #6612: LiveTV_DTV_ringbuffer_check_debug.diff

File LiveTV_DTV_ringbuffer_check_debug.diff, 2.6 KB (added by Shane Shrybman, 16 years ago)

Add ringbuffer check to mpeg and dvb recorders for LiveTV

  • mythtv/libs/libmythtv/dvbrecorder.cpp

    bool DVBRecorder::PauseAndWait(int timeout) 
    486486
    487487bool DVBRecorder::ProcessVideoTSPacket(const TSPacket &tspacket)
    488488{
     489    if (!ringBuffer)
     490    {
     491        VERBOSE(VB_IMPORTANT, LOC + "ProcessVideoTSPacket() no ringBuffer. Start buffering.");
     492        _buffer_packets = true;
     493        return true;
     494    }
    489495    uint streamType = _stream_id[tspacket.PID()];
    490496
    491497    // Check for keyframes and count frames
    bool DVBRecorder::ProcessVideoTSPacket(const TSPacket &tspacket) 
    505511
    506512bool DVBRecorder::ProcessAudioTSPacket(const TSPacket &tspacket)
    507513{
     514    if (!ringBuffer)
     515    {
     516        VERBOSE(VB_IMPORTANT, LOC + "ProcessAudioTSPacket() no ringBuffer. Start buffering");
     517        _buffer_packets = true;
     518        return true;
     519    }
    508520    _buffer_packets = !FindAudioKeyframes(&tspacket);
    509521    return ProcessAVTSPacket(tspacket);
    510522}
    bool DVBRecorder::ProcessAudioTSPacket(const TSPacket &tspacket) 
    512524/// Common code for processing either audio or video packets
    513525bool DVBRecorder::ProcessAVTSPacket(const TSPacket &tspacket)
    514526{
     527    if (!ringBuffer)
     528    {
     529        VERBOSE(VB_IMPORTANT, LOC + "ProcessAVTSPacket() no ringBuffer");
     530        return true;
     531    }
    515532    const uint pid = tspacket.PID();
    516533
    517534    // Check continuity counter
  • mythtv/libs/libmythtv/mpegrecorder.cpp

    bool MpegRecorder::ProcessTSPacket(const TSPacket &tspacket_real) 
    13021302
    13031303bool MpegRecorder::ProcessVideoTSPacket(const TSPacket &tspacket)
    13041304{
     1305    if (!ringBuffer)
     1306    {
     1307        VERBOSE(VB_IMPORTANT, LOC + "ProcessVideoTSPacket() no ringBuffer. Start buffering.");
     1308        _buffer_packets = true;
     1309        return true;
     1310    }
     1311
    13051312    _buffer_packets = !FindH264Keyframes(&tspacket);
    13061313    if (!_seen_sps)
    13071314        return true;
    bool MpegRecorder::ProcessVideoTSPacket(const TSPacket &tspacket) 
    13111318
    13121319bool MpegRecorder::ProcessAudioTSPacket(const TSPacket &tspacket)
    13131320{
     1321    if (!ringBuffer)
     1322    {
     1323        VERBOSE(VB_IMPORTANT, LOC + "ProcessAudioTSPacket() no ringBuffer. Start buffering");
     1324        _buffer_packets = true;
     1325        return true;
     1326    }
     1327
    13141328    _buffer_packets = !FindAudioKeyframes(&tspacket);
    13151329    return ProcessAVTSPacket(tspacket);
    13161330}