Ticket #1959: dvd_changetrack.diff

File dvd_changetrack.diff, 2.2 KB (added by skamithi, 18 years ago)
  • libs/libmythtv/DVDRingBuffer.cpp

     
    963963    return dvdfps;
    964964}
    965965
     966bool DVDRingBufferPriv::IsSameChapter(int tmpcellid, int tmpvobid)
     967{
     968    if ((tmpcellid == cellid) && (tmpvobid == vobid))
     969        return true;
     970
     971    return false;
     972}
     973
    966974/** \fn DVDRingBufferPriv::guess_palette(uint32_t, uint8_t, uint8_t)
    967975 * \brief converts palette values from YUV to RGB
    968976 */
  • libs/libmythtv/DVDRingBuffer.h

     
    6060
    6161    bool JumpToTitle(void) { return jumptotitle; }
    6262    double GetFrameRate(void);
     63    int GetCellID(void) { return cellid; }
     64    int GetVobID(void)  { return vobid; }
     65    bool IsSameChapter(int tmpcellid, int tmpvobid);
    6366   
    6467    // commands
    6568    bool OpenFile(const QString &filename);
  • libs/libmythtv/decoderbase.cpp

     
    689689
    690690void DecoderBase::ChangeDVDTrack(bool ffw)
    691691{
    692     bool result = true;
    693692    if (!ringBuffer->isDVD())
    694693        return;
     694   
     695    bool result = true;
     696    int prevcellstart = ringBuffer->DVD()->GetCellStart();
     697    int prevcellid = ringBuffer->DVD()->GetCellID();
     698    int prevvobid  = ringBuffer->DVD()->GetVobID();
    695699
    696     uint prevcellstart = ringBuffer->DVD()->GetCellStart();
    697 
    698700    if (ffw)
    699701        result = ringBuffer->DVD()->nextTrack();
    700702    else
     
    704706    {
    705707        if ((prevcellstart == 0 && ffw) || (prevcellstart != 0))
    706708        {
    707             while (prevcellstart == ringBuffer->DVD()->GetCellStart())
     709            int limit = 0;
     710            while (ringBuffer->DVD()->IsSameChapter(prevcellid, prevvobid)
     711                    && limit < 50)
     712            {
     713                limt++;
    708714                usleep(10000);
     715            }
    709716        }
    710717
    711718        uint elapsed = ringBuffer->DVD()->GetCellStart();