Ticket #2285: 2285-dbg.patch

File 2285-dbg.patch, 5.5 KB (added by danielk, 19 years ago)

Debugging patch

  • libs/libmythtv/remoteutil.cpp

     
    181181    RemoteGetRecordingList(&expiringlist, strList);
    182182}
    183183
    184 int RemoteGetRecordingList(vector<ProgramInfo *> *reclist, QStringList &strList)
     184int RemoteGetRecordingList(vector<ProgramInfo *> *reclist,
     185                           QStringList &strList)
    185186{
     187    VERBOSE(VB_IMPORTANT, "RemoteGetRecordingList(..."
     188            <<strList[0]<<") -- begin");
    186189    if (!gContext->SendReceiveStringList(strList))
     190    {
     191        VERBOSE(VB_IMPORTANT, "RemoteGetRecordingList(..."
     192                <<strList[0]<<") -- end 0");
    187193        return 0;
     194    }
    188195
    189196    int numrecordings = strList[0].toInt();
    190197
     
    205212        }
    206213    }
    207214
     215    VERBOSE(VB_IMPORTANT, "RemoteGetRecordingList(..."
     216            <<strList[0]<<") -- end "<<numrecordings);
     217
    208218    return numrecordings;
    209219}
    210220
  • programs/mythfrontend/playbackbox.cpp

     
    14311431
    14321432bool PlaybackBox::FillList(bool useCachedData)
    14331433{
     1434    VERBOSE(VB_IMPORTANT, "FillList("
     1435            <<(useCachedData?"use":"no")<<" cache) -- begin");
     1436
    14341437    ProgramInfo *p;
    14351438
    14361439    // Save some information so we can find our place again.
     
    14691472    // objects with the title lists.
    14701473    progLists[""].setAutoDelete(false);
    14711474
     1475    VERBOSE(VB_IMPORTANT, "FillList() 1");
    14721476    fillRecGroupPasswordCache();
    14731477
    14741478    ViewTitleSort titleSort = (ViewTitleSort)gContext->GetNumSetting(
     
    14811485
    14821486    bool LiveTVInAllPrograms = gContext->GetNumSetting("LiveTVInAllPrograms",0);
    14831487
     1488    VERBOSE(VB_IMPORTANT, "FillList() 2");
    14841489    if (!useCachedData || !progCache || progCache->empty())
    14851490    {
    14861491        clearProgramCache();
    14871492
    14881493        progCache = RemoteGetRecordedList(allOrder == 0 || type == Delete);
    14891494    }
     1495    VERBOSE(VB_IMPORTANT, "FillList() 3");
    14901496
    14911497    if (progCache)
    14921498    {
     
    16061612            }
    16071613        }
    16081614    }
     1615    VERBOSE(VB_IMPORTANT, "FillList() 4");
    16091616
    16101617    if (sortedList.count() == 0)
    16111618    {
     
    16151622        titleIndex = 0;
    16161623        playList.clear();
    16171624
     1625        VERBOSE(VB_IMPORTANT, "FillList() -- end A");
    16181626        return 0;
    16191627    }
    16201628
     
    16631671        }
    16641672    }
    16651673
     1674    VERBOSE(VB_IMPORTANT, "FillList() 5");
     1675
    16661676    if (progLists[watchGroup].count() > 1)
    16671677    {
    16681678        QDateTime now = QDateTime::currentDateTime();
     
    18231833        }
    18241834        progLists[watchGroup].Sort(comp_recpriority2);
    18251835    }
     1836    VERBOSE(VB_IMPORTANT, "FillList() 6");
    18261837
    18271838    // Try to find our old place in the title list.  Scan the new
    18281839    // titles backwards until we find where we were or go past.  This
     
    18511862            break;
    18521863    }
    18531864
     1865    VERBOSE(VB_IMPORTANT, "FillList() 7");
    18541866    // Now do pretty much the same thing for the individual shows on
    18551867    // the specific program list if needed.
    18561868    if (oldtitle != titleList[titleIndex] || oldchanid.isNull())
     
    19271939        }
    19281940    }
    19291941
     1942    VERBOSE(VB_IMPORTANT, "FillList() -- end B");
    19301943    return (progCache != NULL);
    19311944}
    19321945
  • programs/mythbackend/mainserver.cpp

     
    88#include <qwaitcondition.h>
    99#include <qregexp.h>
    1010
     11#include <sys/time.h>
    1112#include <cstdlib>
    1213#include <cerrno>
    1314#include <math.h>
     
    10041005
    10051006void MainServer::HandleQueryRecordings(QString type, PlaybackSock *pbs)
    10061007{
     1008    VERBOSE(VB_IMPORTANT, "HandleQueryRecordings("<<type<<") -- begin");
    10071009    MythSocket *pbssock = pbs->getSocket();
    10081010    bool islocal = pbs->isLocal();
    10091011    QString playbackhost = pbs->getHostname();
     
    12311233                    proginfo->pathname = QString("myth://") + ip + ":" + port
    12321234                                         + "/" + basename;
    12331235
     1236                struct timeval stat_beg, stat_end;
     1237                gettimeofday(&stat_beg, NULL);
    12341238                if (proginfo->filesize == 0)
    12351239                {
    12361240                    struct stat st;
     
    12431247
    12441248                    proginfo->SetFilesize(size);
    12451249                }
     1250                gettimeofday(&stat_end, NULL);
     1251
     1252                double stat_time = (stat_end.tv_sec - stat_beg.tv_sec ) +
     1253                    (stat_end.tv_usec - stat_beg.tv_usec) / 1000000.0;
     1254                if (stat_time > 1.0)
     1255                {
     1256                    VERBOSE(VB_IMPORTANT, QString(
     1257                                "stat took %1 seconds on file '%2'"
     1258                                "\n\t\t\ttitle: '%3' \nsubtitle: '%4' with avail '%5'")
     1259                            .arg(stat_time)
     1260                            .arg(proginfo->pathname).arg(proginfo->title)
     1261                            .arg(proginfo->subtitle).arg(
     1262                                (proginfo->availableStatus==asAvailable) ?
     1263                                "available" :
     1264                                ((proginfo->availableStatus==asPendingDelete) ?
     1265                                 "deleting" :
     1266                                 ((proginfo->availableStatus==asFileNotFound) ?
     1267                                  "file not found" : "unnknown"))));
     1268                }
    12461269            }
    12471270            else
    12481271            {