Ticket #1827: dvd_seek_improv2.diff

File dvd_seek_improv2.diff, 1.9 KB (added by skamithi, 19 years ago)

noticed that when DVDRB::Seek is run and it fails, waiting til the next cell change makes it work again.

  • libs/libmythtv/DVDRingBuffer.cpp

     
    4040      menupktpts(0), curAudioTrack(0),
    4141      curSubtitleTrack(0), autoselectaudio(true),
    4242      autoselectsubtitle(true),
    43       jumptotitle(true), parent(0)
     43      jumptotitle(true), repeatseek(false),
     44      seekpos(0), seekwhence(0),
     45      parent(0)
    4446{
    4547}
    4648
     
    6163
    6264long long DVDRingBufferPriv::Seek(long long pos, int whence)
    6365{
    64     dvdnav_sector_search(this->dvdnav, pos / DVD_BLOCK_SIZE , whence);
     66    dvdnav_status_t dvdRet = dvdnav_sector_search(this->dvdnav, pos / DVD_BLOCK_SIZE , whence);
     67    if (dvdRet == DVDNAV_STATUS_ERR && !repeatseek)
     68    {
     69        VERBOSE(VB_PLAYBACK, LOC + QString("Seek failed to jump to position %1").arg(pos) +
     70                            " Will try and seek to this position at the next cell change");
     71        repeatseek = true;
     72        seekpos = pos;
     73        seekwhence = whence;
     74    }
    6575    gotStop = false;
    6676    return GetReadPosition();
    6777}
     
    264274                    autoselectsubtitle = true;
    265275                }
    266276
     277                if (repeatseek)
     278                {
     279                    Seek(seekpos, seekwhence);
     280                    repeatseek = false;
     281                }       
     282
    267283                if (blockBuf != dvdBlockWriteBuf)
    268284                {
    269285                    dvdnav_free_cache_block(dvdnav, blockBuf);
  • libs/libmythtv/DVDRingBuffer.h

     
    142142    const char     *dvdname;
    143143    const char     *serialnumber;
    144144    bool           jumptotitle;
     145    bool           repeatseek;
     146    long long      seekpos;
     147    int            seekwhence;
    145148
    146149    NuppelVideoPlayer *parent;
    147150