Ticket #13207: 13207-debug7.patch

File 13207-debug7.patch, 7.0 KB (added by gigem, 6 years ago)
  • mythtv/libs/libmythtv/eitscanner.cpp

    diff --git a/mythtv/libs/libmythtv/eitscanner.cpp b/mythtv/libs/libmythtv/eitscanner.cpp
    index 677feddab8..e707600365 100644
    a b void EITScanner::StartActiveScan(TVRec *_rec, uint max_seconds_per_source) 
    283283
    284284void EITScanner::StopActiveScan(void)
    285285{
     286    LOG(VB_EIT, LOG_INFO,
     287        LOC_ID + QString("##StopActiveScan() entering"));
    286288    QMutexLocker locker(&lock);
     289    LOG(VB_EIT, LOG_INFO,
     290        LOC_ID + QString("##StopActiveScan() locked"));
    287291
    288292    activeScanStopped = false;
    289293    activeScan = false;
    290294    exitThreadCond.wakeAll();
     295    LOG(VB_EIT, LOG_INFO,
     296        LOC_ID + QString("##StopActiveScan() woke all"));
    291297
    292298    locker.unlock();
     299    LOG(VB_EIT, LOG_INFO,
     300        LOC_ID + QString("##StopActiveScan() unlocked"));
    293301    StopPassiveScan();
    294302    locker.relock();
     303    LOG(VB_EIT, LOG_INFO,
     304        LOC_ID + QString("##StopActiveScan() relocked"));
    295305
    296306    while (!activeScan && !activeScanStopped)
    297307        activeScanCond.wait(&lock, 100);
    298308
     309    LOG(VB_EIT, LOG_INFO,
     310        LOC_ID + QString("##StopActiveScan() finished"));
    299311    rec = NULL;
    300312}
  • mythtv/libs/libmythtv/recorders/dvbchannel.cpp

    diff --git a/mythtv/libs/libmythtv/recorders/dvbchannel.cpp b/mythtv/libs/libmythtv/recorders/dvbchannel.cpp
    index dbdf7adc11..2215c0ecff 100644
    a b DVBChannel::~DVBChannel() 
    145145
    146146void DVBChannel::Close(DVBChannel *who)
    147147{
    148     LOG(VB_CHANNEL, LOG_INFO, LOC + "Closing DVB channel");
     148    LOG(VB_CHANNEL, LOG_INFO, LOC + "##Closing DVB channel");
    149149
    150150    IsOpenMap::iterator it = is_open.find(who);
    151151    if (it == is_open.end())
     152    {
     153        LOG(VB_CHANNEL, LOG_INFO, LOC + "  ##Not open");
    152154        return; // this caller didn't have it open in the first place..
     155    }
    153156
    154157    is_open.erase(it);
    155158
    void DVBChannel::Close(DVBChannel *who) 
    163166        master->Close(this);
    164167        fd_frontend = -1;
    165168        ReturnMasterLock(master);
     169        LOG(VB_CHANNEL, LOG_INFO, LOC + "  ##master->Close9) succeeded");
    166170        return;
    167171    }
    168172    ReturnMasterLock(master); // if we're the master we don't need this lock..
    169173
    170174    if (!is_open.empty())
     175    {
     176        LOG(VB_CHANNEL, LOG_INFO, LOC + "  ##still has other callers");
    171177        return; // not all callers have closed the DVB channel yet..
     178    }
    172179
    173180    if (diseqc_tree)
    174181        diseqc_tree->Close();
    void DVBChannel::Close(DVBChannel *who) 
    180187
    181188        dvbcam->Stop();
    182189    }
     190    LOG(VB_CHANNEL, LOG_INFO, LOC + "##Succeeded");
    183191}
    184192
    185193bool DVBChannel::Open(DVBChannel *who)
    186194{
    187     LOG(VB_CHANNEL, LOG_INFO, LOC + "Opening DVB channel");
     195    LOG(VB_CHANNEL, LOG_INFO, LOC + "##Opening DVB channel");
    188196
    189197    if (!m_inputid)
    190198    {
    191199        if (!InitializeInput())
     200        {
     201            LOG(VB_CHANNEL, LOG_INFO, LOC + "  ##InitializeInput() failed");
    192202            return false;
     203        }
    193204    }
    194205
    195206    QMutexLocker locker(&hw_lock);
    196207
    197208    if (fd_frontend >= 0)
    198209    {
     210        LOG(VB_CHANNEL, LOG_INFO, LOC + "  ##fd_frontend already set");
    199211        is_open[who] = true;
    200212        return true;
    201213    }
    bool DVBChannel::Open(DVBChannel *who) 
    205217    {
    206218        if (!master->Open(who))
    207219        {
     220            LOG(VB_CHANNEL, LOG_INFO, LOC + "  ##master->Open() failed");
    208221            ReturnMasterLock(master);
    209222            return false;
    210223        }
    bool DVBChannel::Open(DVBChannel *who) 
    223236
    224237        if (!InitializeInput())
    225238        {
     239            LOG(VB_CHANNEL, LOG_INFO, LOC + "  ##InitializeInput2() failed");
    226240            Close();
    227241            ReturnMasterLock(master);
    228242            return false;
    229243        }
    230244
     245        LOG(VB_CHANNEL, LOG_INFO, LOC + "  ##InitializeInput2() succedded");
    231246        ReturnMasterLock(master);
    232247        return true;
    233248    }
    bool DVBChannel::Open(DVBChannel *who) 
    242257        if (fd_frontend >= 0)
    243258            break;
    244259        LOG(VB_GENERAL, LOG_WARNING, LOC +
    245             "Opening DVB frontend device failed." + ENO);
     260            "  ##Opening DVB frontend device failed." + ENO);
    246261        if (tries >= 20 || (errno != EBUSY && errno != EAGAIN))
    247262        {
    248263            LOG(VB_GENERAL, LOG_ERR, LOC +
    249                 QString("Failed to open DVB frontend device due to "
     264                QString("  ##Failed to open DVB frontend device due to "
    250265                        "fatal error or too many attempts."));
    251266            return false;
    252267        }
    bool DVBChannel::Open(DVBChannel *who) 
    258273    if (ioctl(fd_frontend, FE_GET_INFO, &info) < 0)
    259274    {
    260275        LOG(VB_GENERAL, LOG_ERR, LOC +
    261             "Failed to get frontend information." + ENO);
     276            "  ##Failed to get frontend information." + ENO);
    262277
    263278        close(fd_frontend);
    264279        fd_frontend = -1;
    bool DVBChannel::Open(DVBChannel *who) 
    312327
    313328    if (!InitializeInput())
    314329    {
     330        LOG(VB_CHANNEL, LOG_INFO, LOC + "  ##InitializeInput3() failed");
    315331        Close();
    316332        return false;
    317333    }
    bool DVBChannel::Open(DVBChannel *who) 
    319335    if (fd_frontend >= 0)
    320336        is_open[who] = true;
    321337
     338    LOG(VB_CHANNEL, LOG_INFO, LOC + "##Succedded");
    322339    return (fd_frontend >= 0);
    323340}
    324341
  • mythtv/libs/libmythtv/tv_rec.cpp

    diff --git a/mythtv/libs/libmythtv/tv_rec.cpp b/mythtv/libs/libmythtv/tv_rec.cpp
    index 6556380a1f..81e94ea831 100644
    a b void TVRec::run(void) 
    14711471                else
    14721472                {
    14731473                    LOG(VB_CHANNEL, LOG_INFO, LOC + QString(
    1474                             "Postponing EIT scan on input %1 "
     1474                            "##Postponing EIT scan on input %1 "
    14751475                            "because input %2 is busy")
    14761476                        .arg(inputid).arg(busy_input.inputid));
    14771477                    eitScanStartTime = eitScanStartTime.addSecs(300);
    void TVRec::HandlePendingRecordings(void) 
    15671567{
    15681568    QMutexLocker pendlock(&pendingRecLock);
    15691569
    1570     if (pendingRecordings.empty())
    1571         return;
    1572 
    1573     // If we have a pending recording and AskAllowRecording
    1574     // or DoNotAskAllowRecording is set and the frontend is
    1575     // ready send an ASK_RECORDING query to frontend.
    1576 
    15771570    PendingMap::iterator it, next;
    15781571
    15791572    for (it = pendingRecordings.begin(); it != pendingRecordings.end();)
    void TVRec::HandlePendingRecordings(void) 
    15921585        it = next;
    15931586    }
    15941587
     1588    if (pendingRecordings.empty())
     1589        return;
     1590
     1591    // Make sure EIT scan is stopped so it does't interfere
     1592    if (scanner && HasFlags(kFlagEITScannerRunning))
     1593    {
     1594        LOG(VB_CHANNEL, LOG_INFO, LOC + "##Stopping active EIT scan for pending recording.");
     1595        tuningRequests.enqueue(TuningRequest(kFlagNoRec));
     1596    }
     1597
     1598    // If we have a pending recording and AskAllowRecording
     1599    // or DoNotAskAllowRecording is set and the frontend is
     1600    // ready send an ASK_RECORDING query to frontend.
     1601
    15951602    bool has_rec = false;
    15961603    it = pendingRecordings.begin();
    15971604    if ((1 == pendingRecordings.size()) &&