Ticket #6612: NVP_PrebufferEnoughFrames_tweaks.diff

File NVP_PrebufferEnoughFrames_tweaks.diff, 1.6 KB (added by Shane Shrybman, 11 years ago)

Wait a little longer for prebuffering

  • mythtv/libs/libmythtv/NuppelVideoPlayer.cpp

    bool NuppelVideoPlayer::PrebufferEnoughFrames(void) 
    27402740            audio_paused = prebuffering;
    27412741        }
    27422742
    2743         VERBOSE(VB_PLAYBACK, LOC + QString("Waiting for prebuffer.. %1 %2")
    2744                 .arg(prebuffer_tries_total + prebuffer_tries, 2)
    2745                 .arg(videoOutput->GetFrameStatus()));
    2746         if (!prebuffering_wait.wait(&prebuffering_lock,
    2747                                     frame_interval * 4 / 1000))
     2743        bool ret = false;
     2744        if (!prebuffering_wait.wait(&prebuffering_lock, (prebuffer_tries + 1) *
     2745                                    frame_interval * 3 / 1000))
    27482746        {
    2749             // timed out.. do we need to know?
     2747            VERBOSE(VB_PLAYBACK, LOC + QString("Prebuffering time out. %1 %2")
     2748                    .arg(prebuffer_tries).arg(videoOutput->GetFrameStatus()));
     2749            ++prebuffer_tries;
    27502750        }
    2751         ++prebuffer_tries;
     2751        else
     2752        {
     2753            prebuffer_tries = 0;
     2754            ret = true;
     2755        }
     2756
    27522757        if (prebuffering && (prebuffer_tries >= 10))
    27532758        {
    27542759            prebuffer_tries_total += prebuffer_tries;
    bool NuppelVideoPlayer::PrebufferEnoughFrames(void) 
    27782783        prebuffering_lock.unlock();
    27792784        videosync->Start();
    27802785
    2781         return false;
     2786        return ret;
    27822787    }
    27832788    prebuffering_lock.unlock();
    27842789