Ticket #2426: isnearend.diff

File isnearend.diff, 3.8 KB (added by skamithi, 5 years ago)

change the IsNearEnd?? detection code in tv_play.cpp. makes it easier for the next enhancement, i'll introduce in a later ticket which is to keep the prerecorded running during the program guide.

  • libs/libmythtv/tv_play.h

     
    164164    bool IsErrored(void)         const { return errored; } 
    165165    /// true if dialog is either videoplayexit, playexit or askdelete dialog 
    166166    bool IsVideoExitDialog(void); 
     167    /// true if NVP is near the end 
     168    bool IsNearEnd(void) { return isnearend; } 
     169 
    167170     
    168171    // Other queries 
    169172    int GetLastRecorderNum(void) const; 
     
    528531     
    529532    bool         inPlaylist; ///< show is part of a playlist 
    530533    bool         underNetworkControl; ///< initial show started via by the network control interface 
     534    bool         isnearend; 
    531535 
    532536    // Recording to play next, after LiveTV 
    533537    ProgramInfo *pseudoLiveTVRec[2]; 
  • libs/libmythtv/tv_play.cpp

     
    461522      playbackinfo(NULL), playbackLen(0), 
    462523      lastProgram(NULL), jumpToProgram(false), 
    463524      inPlaylist(false), underNetworkControl(false), 
     525      isnearend(false), 
    464526      // Video Players 
    465527      nvp(NULL), pipnvp(NULL), activenvp(NULL), 
    466528      // Remote Encoders 
     
    17731835                    nvp->SetWatched(); 
    17741836                VERBOSE(VB_PLAYBACK, LOC_ERR + "nvp->IsPlaying() timed out"); 
    17751837            } 
     1838 
     1839            if (nvp->IsNearEnd()) 
     1840                isnearend = true; 
     1841            else 
     1842                isnearend = false; 
     1843             
     1844            if (isnearend && IsEmbedding() && !paused) 
     1845                DoPause(); 
    17761846        } 
    17771847 
    17781848        if (!endOfRecording) 
    17791849        { 
    1780  
    1781             
    1782             if (jumped_back && !nvp->IsNearEnd()) 
     1850            if (jumped_back && !isnearend) 
    17831851                jumped_back = false; 
    17841852             
    17851853            if (internalState == kState_WatchingPreRecorded && !inPlaylist && 
    1786                 dialogname == "" && nvp->IsNearEnd() && !exitPlayer && !underNetworkControl && 
     1854                dialogname == "" && isnearend && !exitPlayer  
     1855                && !underNetworkControl && 
    17871856                (gContext->GetNumSetting("EndOfRecordingExitPrompt") == 1) && 
    1788                 !jumped_back && !editmode) 
     1857                !jumped_back && !editmode && !IsEmbedding() && !paused) 
    17891858            { 
    1790                 if (IsEmbedding()) 
    1791                     StopEmbeddingOutput(); 
    1792                 else 
    1793                     PromptDeleteRecording(tr("End Of Recording")); 
     1859                PromptDeleteRecording(tr("End Of Recording")); 
    17941860            } 
    17951861             
    17961862                 
     
    23152381                else 
    23162382                    DoSeek(-rewtime, tr("Skip Back")); 
    23172383            } 
    2318             else if (action == "ESCAPE" && activenvp->IsNearEnd()) 
     2384            else if (action == "ESCAPE" && isnearend) 
    23192385            { 
    23202386                requestDelete = false; 
    23212387                exitPlayer    = true; 
     
    24062472                            wantsToQuit = true; 
    24072473                            break; 
    24082474                        default: 
    2409                             if (activenvp->IsNearEnd()) 
     2475                            if (isnearend) 
    24102476                            { 
    24112477                                exitPlayer = true; 
    24122478                                wantsToQuit = true; 
  • programs/mythfrontend/playbackbox.cpp

     
    37053705 
    37063706void PlaybackBox::timeout(void) 
    37073707{ 
    3708     if (m_player && !m_player->IsEmbedding() && 
    3709         playbackVideoContainer) 
    3710     { 
    3711         exitWin(); 
    3712     } 
    3713  
    37143708    if (titleList.count() <= 1) 
    37153709        return; 
    37163710