Ticket #3019: continue_play_while_in_program_guide.diff

File continue_play_while_in_program_guide.diff, 3.3 KB (added by skamithi, 17 years ago)
  • libs/libmythtv/guidegrid.cpp

     
    3333#include "remoteutil.h"
    3434#include "channelutil.h"
    3535
     36QWaitCondition ggIsVisibleCond;
     37
    3638bool RunProgramGuide(uint &chanid, QString &channum,
    3739                     bool thread, TV *player,
    3840                     bool allowsecondaryepg)
     
    5355    if (thread)
    5456    {
    5557        qApp->unlock();
    56 
    57         while (gg->isVisible())
    58             usleep(50);
     58        ggIsVisibleCond.wait();
    5959    }
    6060    else
    6161        gg->exec();
     
    292297    m_channelInfos.clear();
    293298
    294299    delete theme;
     300
     301    if (timeCheck)
     302    {
     303        timeCheck->disconnect(this);
     304        timeCheck->deleteLater();
     305        timeCheck = NULL;
     306    }
     307
     308    if (jumpToChannelTimer)
     309    {
     310        jumpToChannelTimer->disconnect(this);
     311        jumpToChannelTimer->deleteLater();
     312        jumpToChannelTimer = NULL;
     313    }
    295314}
    296315
    297316void GuideGrid::keyPressEvent(QKeyEvent *e)
     
    16351654    }
    16361655
    16371656    unsetCursor();
     1657    ggIsVisibleCond.wakeAll();
    16381658    accept();
    16391659}
    16401660
  • libs/libmythtv/tv_play.cpp

     
    49965062    bool changeChannel = false;
    49975063    ProgramInfo *nextProgram = NULL;
    49985064
     5065    // See if we can provide a channel preview in EPG
     5066    bool allowsecondary = true;
     5067    if (nvp && nvp->getVideoOutput())
     5068        allowsecondary = nvp->getVideoOutput()->AllowPreviewEPG();
     5069     
    49995070    if (StateIsLiveTV(GetState()))
    50005071    {
    50015072        switch (editType)
     
    50035074            default:
    50045075            case kScheduleProgramGuide:
    50055076            {
    5006                 // See if we can provide a channel preview in EPG
    5007                 bool allowsecondary = true;
    5008                 if (nvp && nvp->getVideoOutput())
    5009                     allowsecondary = nvp->getVideoOutput()->AllowPreviewEPG();
    5010 
    50115077                // Start up EPG
    50125078                changeChannel = RunProgramGuide(chanid, channum, true, this, allowsecondary);
    50135079                break;
     
    50475113        if (!paused)
    50485114            DoPause(false);
    50495115
     5116        long long margin =
     5117            (long long)(nvp->GetFrameRate() * nvp->GetAudioStretchFactor());
     5118
    50505119        switch (editType)
    50515120        {
    50525121            default:
    50535122            case kScheduleProgramGuide:
    5054                 RunProgramGuide(chanid, channum, true);
     5123            {
     5124                if (!stayPaused && paused && !isnearend)
     5125                {
     5126                    DoPause(false);
     5127                    stayPaused = true;
     5128                }
     5129                RunProgramGuide(chanid, channum, true, this, allowsecondary);
    50555130                break;
     5131            }
    50565132            case kScheduleProgramFinder:
    50575133                RunProgramFind(true, false);
    50585134                break;
     
    50675143            }
    50685144            case kPlaybackBox:
    50695145            {
    5070                 long long margin =
    5071                     (long long)(nvp->GetFrameRate() * nvp->GetAudioStretchFactor());
    50725146                // keep video paused if only 5 seconds left in recording
    50735147                margin = margin * 5;
    50745148                QDomElement pbbxmldata;