Ticket #1888: sigmon_dump.diff

File sigmon_dump.diff, 1.5 KB (added by Janne <janne-mythtv@…>, 14 years ago)

debugging patch

  • libs/libmythtv/dvbsignalmonitor.cpp

    old new bool DVBSignalMonitor::UpdateFiltersFrom 
    317317 */
    318318void DVBSignalMonitor::RunTableMonitorTS(void)
    319319{
     320    int debug_fd; QString debug_out = QString("dvbsignalmonitor%1_data.dump").arg(channel->GetDevice());
    320321    int remainder = 0;
    321322    int buffer_size = TSPacket::SIZE * 15000;
    322323    unsigned char *buffer = new unsigned char[buffer_size];
    void DVBSignalMonitor::RunTableMonitorTS 
    324325        return;
    325326    bzero(buffer, buffer_size);
    326327
     328    debug_fd = open(debug_out.ascii(), O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
     329
    327330    QString dvr_fname = CardUtil::GetDeviceName(DVB_DEV_DVR, GetDVBCardNum());
    328331    int dvr_fd = open(dvr_fname.ascii(), O_RDONLY | O_NONBLOCK);
    329332    if (dvr_fd < 0)
    void DVBSignalMonitor::RunTableMonitorTS 
    369372        }
    370373
    371374        remainder = GetStreamData()->ProcessData(buffer, len);
     375        write(debug_fd, buffer, len-remainder);
    372376        if (remainder > 0 && (len > remainder)) // leftover bytes
    373377            memmove(buffer, &(buffer[len - remainder]), remainder);
    374378    }
    void DVBSignalMonitor::RunTableMonitorTS 
    387391    }
    388392
    389393    close(dvr_fd);
     394    close(debug_fd);
    390395    delete[] buffer;
    391396
    392397    VERBOSE(VB_CHANNEL, LOC + "RunTableMonitorTS(): " + "end");