Ticket #12902: 20181203_1625_filechanged.patch

File 20181203_1625_filechanged.patch, 2.3 KB (added by Peter Bennett, 15 months ago)

Possible fix

  • mythtv/libs/libmythtv/mythplayer.cpp

    diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
    index ba516025017..5488781d6bd 100644
    a b MythPlayer::MythPlayer(PlayerFlags flags) 
    202202      frame_interval((int)(1000000.0f / 30)), m_frame_interval(0),
    203203      m_fpsMultiplier(1),
    204204      ffrew_skip(1),ffrew_adjust(0),
     205      fileChanged(false),
    205206      // Audio and video synchronization stuff
    206207      videosync(nullptr),           avsync_delay(0),
    207208      avsync_adjustment(0),         avsync_avg(0),
    void MythPlayer::SwitchToProgram(void) 
    30553056    LOG(VB_PLAYBACK, LOG_INFO, LOC + "SwitchToProgram - end");
    30563057}
    30573058
     3059// This is called from decoder thread. Set an indicator that will
     3060// be checked and actioned in the player thread.
    30583061void MythPlayer::FileChangedCallback(void)
    30593062{
    30603063    LOG(VB_PLAYBACK, LOG_INFO, LOC + "FileChangedCallback");
     3064    fileChanged = true;
     3065}
     3066
     3067// Called from the player thread.
     3068void MythPlayer::FileChanged(void)
     3069{
     3070    fileChanged = false;
     3071    LOG(VB_PLAYBACK, LOG_INFO, LOC + "FileChanged");
    30613072
    30623073    Pause();
    30633074    ChangeSpeed();
    void MythPlayer::FileChangedCallback(void) 
    30803091    forcePositionMapSync = true;
    30813092}
    30823093
     3094
     3095
     3096
    30833097void MythPlayer::JumpToProgram(void)
    30843098{
    30853099    LOG(VB_PLAYBACK, LOG_INFO, LOC + "JumpToProgram - start");
    void MythPlayer::EventStart(void) 
    32953309
    32963310void MythPlayer::EventLoop(void)
    32973311{
     3312    // Live TV program change
     3313    if (fileChanged)
     3314        FileChanged();
     3315
    32983316    // recreate the osd if a reinit was triggered by another thread
    32993317    if (reinit_osd)
    33003318        ReinitOSD();
  • mythtv/libs/libmythtv/mythplayer.h

    diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h
    index c80d9ecb677..68371ea729f 100644
    a b class MTV_PUBLIC MythPlayer 
    393393    FrameScanType GetScanType(void) const { return m_scan; }
    394394    bool IsScanTypeLocked(void) const { return m_scan_locked; }
    395395    void Zoom(ZoomDirection direction);
     396    void FileChanged(void);
     397
    396398
    397399    // Windowing stuff
    398400    void EmbedInWidget(QRect rect);
    class MTV_PUBLIC MythPlayer 
    818820
    819821    int        ffrew_skip;
    820822    int        ffrew_adjust;
     823    bool       fileChanged;
    821824
    822825    // Audio and video synchronization stuff
    823826    VideoSync *videosync;