Ticket #11276: 0001-Always-update-the-still-frame-timer-whenever-the-tim.patch

File 0001-Always-update-the-still-frame-timer-whenever-the-tim.patch, 2.5 KB (added by peper03@…, 7 years ago)

Improved patch to ensure the timer is reset whenever a still frame should be skipped.

  • mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp

    From da7d625466eb344cfd21b896a7c120d1d33a6fc2 Mon Sep 17 00:00:00 2001
    From: Richard <peper03@yahoo.com>
    Date: Sun, 9 Dec 2012 20:24:01 +0100
    Subject: [PATCH] Always update the still frame timer whenever the timeout
     changes (including when it should be disabled) to ensure
     that it doesn't 'expire' accidentally and cause the next
     still frame (at whatever point in time that may be) to be
     skipped.
    
    ---
     mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp |   14 +++++++++-----
     mythtv/libs/libmythtv/DVD/mythdvdplayer.cpp |    8 +++++++-
     2 files changed, 16 insertions(+), 6 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp b/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp
    index cb9b1af..1015f49 100644
    a b int DVDRingBuffer::safe_read(void *data, uint sz) 
    657657                    WaitForPlayer();
    658658                }
    659659
    660                 // if the new cell is a still frame, reset the timer
     660                // Make sure the still frame timer is updated (if this isn't
     661                // a still frame, this will ensure the timer knows about it).
    661662                if (m_parent)
    662663                {
    663                     if (m_still && (m_still < 0xff))
    664                         m_parent->ResetStillFrameTimer();
    665                     else
    666                         m_parent->SetStillFrameTimeout(0);
     664                    m_parent->SetStillFrameTimeout(m_still);
    667665                }
    668666
    669667                // clear menus/still frame selections
    void DVDRingBuffer::SkipStillFrame(void) 
    10691067    QMutexLocker locker(&m_seekLock);
    10701068    LOG(VB_PLAYBACK, LOG_INFO, LOC + "Skipping still frame.");
    10711069    dvdnav_still_skip(m_dvdnav);
     1070
     1071    // Make sure the still frame timer is disabled.
     1072    if (m_parent)
     1073    {
     1074        m_parent->SetStillFrameTimeout(0);
     1075    }
    10721076}
    10731077
    10741078void DVDRingBuffer::WaitSkip(void)
  • mythtv/libs/libmythtv/DVD/mythdvdplayer.cpp

    diff --git a/mythtv/libs/libmythtv/DVD/mythdvdplayer.cpp b/mythtv/libs/libmythtv/DVD/mythdvdplayer.cpp
    index 1c4fa45..463b384 100644
    a b void MythDVDPlayer::ResetStillFrameTimer(void) 
    657657
    658658void MythDVDPlayer::SetStillFrameTimeout(int length)
    659659{
    660     m_stillFrameLength = length;
     660    if (length != m_stillFrameLength)
     661    {
     662        m_stillFrameTimerLock.lock();
     663        m_stillFrameLength = length;
     664        m_stillFrameTimer.restart();
     665        m_stillFrameTimerLock.unlock();
     666    }
    661667}
    662668
    663669void MythDVDPlayer::StillFrameCheck(void)