Ticket #9546: 104-corrupted_stream_fix.patch

File 104-corrupted_stream_fix.patch, 2.9 KB (added by Jiri Fojtasek <jiri.fojtasek@…>, 13 years ago)

the patch

  • libs/libmythtv/mythplayer.cpp

    diff -u -r -p mythtv.101/libs/libmythtv/mythplayer.cpp mythtv/libs/libmythtv/mythplayer.cpp
    old new bool MythPlayer::Pause(void) 
    340340    next_normal_speed = false;
    341341    PauseVideo();
    342342    audio.Pause(true);
    343     PauseBuffer();
    344343    PauseDecoder();
     344    PauseBuffer();
    345345    allpaused = decoderPaused && videoPaused && bufferPaused;
    346346    {
    347347        QMutexLocker locker(&decoder_change_lock);
  • libs/libmythtv/ringbuffer.cpp

    diff -u -r -p mythtv.101/libs/libmythtv/ringbuffer.cpp mythtv/libs/libmythtv/ringbuffer.cpp
    old new bool RingBuffer::WaitForAvail(int count) 
    936936    int avail = ReadBufAvail();
    937937    count = (ateof && avail < count) ? avail : count;
    938938
     939    if (setswitchtonext && avail < count)
     940    {
     941        VERBOSE(VB_IMPORTANT, "Checking to see if there's a "
     942                "new livetv program to switch to..");
     943        livetvchain->ReloadAll();
     944
     945        return false;
     946    }
     947
    939948    MythTimer t;
    940949    t.start();
    941950    while ((avail < count) && !stopreads &&
    bool RingBuffer::WaitForAvail(int count) 
    945954        generalWait.wait(&rwlock, 250);
    946955        avail = ReadBufAvail();
    947956
    948         if ((ateof || setswitchtonext) && avail < count)
     957        if (ateof && avail < count)
    949958            count = avail;
    950959
    951960        if (avail < count)
    bool RingBuffer::WaitForAvail(int count) 
    964973                        " seconds for data \n\t\t\tto become available..." +
    965974                        QString(" %2 < %3")
    966975                        .arg(avail).arg(count));
    967                 if (livetvchain)
    968                 {
    969                     VERBOSE(VB_IMPORTANT, "Checking to see if there's a "
    970                                           "new livetv program to switch to..");
    971                     livetvchain->ReloadAll();
    972                 }
    973976            }
    974977
    975             bool quit = livetvchain && (livetvchain->NeedsToSwitch() ||
    976                                         livetvchain->NeedsToJump() ||
    977                                         setswitchtonext);
    978 
    979             if (elapsed > 16000 || quit)
     978            if (elapsed > 16000)
    980979            {
    981                 if (!quit)
    982                     VERBOSE(VB_IMPORTANT, LOC_ERR + "Waited " +
    983                             QString("%1").arg(elapsed/1000) +
    984                             " seconds for data, aborting.");
    985                 else
    986                     VERBOSE(VB_IMPORTANT, LOC + "Timing out wait due to "
    987                             "impending livetv switch.");
    988 
     980                VERBOSE(VB_IMPORTANT, LOC_ERR + "Waited " +
     981                        QString("%1").arg(elapsed/1000) +
     982                        " seconds for data, aborting.");
    989983                return false;
    990984            }
    991985        }