Ticket #11572: 0001-Fixed-seeking-issues-on-some-DVDs-where-for-example-.patch

File 0001-Fixed-seeking-issues-on-some-DVDs-where-for-example-.patch, 4.0 KB (added by peper03@…, 13 years ago)
  • mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp

    From b6260f55a0703edca761c212f2eda936e4cb961d Mon Sep 17 00:00:00 2001
    From: Richard <peper03@yahoo.com>
    Date: Mon, 3 Jun 2013 00:51:28 +0200
    Subject: [PATCH] Fixed seeking issues on some DVDs where, for example, trying
     to jump backwards could actually cause playback to jump
     forwards.
    
    dvdnav_absolute_time_search in libdvdnav (renamed from the original dvdnav_time_search but functionally the same) uses a time offset with a start sector, which will only work if all NAV packets are equally spaced.  On at least one DVD that had issues, the distance between consecutive NAV packets ranged from 96 to 457.
    
    The existing mechanism to check whether a seek was successful and, if not, narrow in on the required time was broken when jumping backwards.
    ---
     mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp |    8 ++++----
     mythtv/libs/libmythtv/DVD/dvdringbuffer.h   |    6 +++---
     mythtv/libs/libmythtv/tv_play.cpp           |    2 +-
     3 files changed, 8 insertions(+), 8 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp b/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp
    index 3f99f3b..5b64e28 100644
    a b long long DVDRingBuffer::Seek(long long time)  
    275275    }
    276276    else
    277277    {
    278         m_seektime = (uint64_t)time;
    279         dvdRet = dvdnav_absolute_time_search(m_dvdnav, m_seektime, 0);
     278        m_seektime = time;
     279        dvdRet = dvdnav_absolute_time_search(m_dvdnav, (uint64_t)m_seektime, 0);
    280280    }
    281281
    282282    LOG(VB_PLAYBACK, LOG_DEBUG,
    int DVDRingBuffer::safe_read(void *data, uint sz)  
    781781                }
    782782
    783783                // update our status
    784                 m_currentTime = (uint)dvdnav_get_current_time(m_dvdnav);
     784                m_currentTime = dvdnav_get_current_time(m_dvdnav);
    785785                m_currentpos = GetReadPosition();
    786786
    787787                if (m_seeking)
    int DVDRingBuffer::safe_read(void *data, uint sz)  
    789789
    790790                    int relativetime =
    791791                        (int)((m_seektime - m_currentTime)/ 90000);
    792                     if (relativetime <= 1)
     792                    if (abs(relativetime) <= 1)
    793793                    {
    794794                        m_seeking = false;
    795795                        m_seektime = 0;
  • mythtv/libs/libmythtv/DVD/dvdringbuffer.h

    diff --git a/mythtv/libs/libmythtv/DVD/dvdringbuffer.h b/mythtv/libs/libmythtv/DVD/dvdringbuffer.h
    index 9c4b6cf..56a42b3 100644
    a b class MTV_PUBLIC DVDRingBuffer : public RingBuffer  
    129129
    130130    virtual void IgnoreWaitStates(bool ignore) { m_skipstillorwait = ignore; }
    131131    void AudioStreamsChanged(bool change) { m_audioStreamsChanged = change; }
    132     uint GetCurrentTime(void)             { return (m_currentTime / 90000); }
     132    int64_t GetCurrentTime(void)          { return (m_currentTime / 90000); }
    133133    uint TitleTimeLeft(void);
    134134    void  SetTrack(uint type, int trackNo);
    135135    int   GetTrack(uint type);
    class MTV_PUBLIC DVDRingBuffer : public RingBuffer  
    198198    const char    *m_dvdname;
    199199    const char    *m_serialnumber;
    200200    bool           m_seeking;
    201     uint64_t       m_seektime;
    202     uint           m_currentTime;
     201    int64_t        m_seektime;
     202    int64_t        m_currentTime;
    203203    QMap<uint, uint> m_seekSpeedMap;
    204204    QMap<uint, QList<uint64_t> > m_chapterMap;
    205205
  • mythtv/libs/libmythtv/tv_play.cpp

    diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
    index eebb902..004021f 100644
    a b void TV::DVDJumpForward(PlayerContext *ctx)  
    1294512945    {
    1294612946        uint titleLength = dvdrb->GetTotalTimeOfTitle();
    1294712947        uint chapterLength = dvdrb->GetChapterLength();
    12948         uint currentTime = dvdrb->GetCurrentTime();
     12948        uint currentTime = (uint)dvdrb->GetCurrentTime();
    1294912949        if ((titleLength == chapterLength) &&
    1295012950             (currentTime < (chapterLength - (ctx->jumptime * 60))) &&
    1295112951             chapterLength > 300)