Ticket #11278: 0001-Use-last-known-good-FPS-value-if-available-when-re-s.patch

File 0001-Use-last-known-good-FPS-value-if-available-when-re-s.patch, 1.9 KB (added by peper03@…, 11 years ago)
  • mythtv/libs/libmythtv/avformatdecoder.cpp

    From d890610866348c366eb86bda553134d6497bb682 Mon Sep 17 00:00:00 2001
    From: Richard <peper03@yahoo.com>
    Date: Fri, 7 Dec 2012 11:13:33 +0100
    Subject: [PATCH] Use last known good FPS value if available when
     (re-)scanning streams to avoid glitches when watching
     content at a different framerate to the local standard
     (e.g. an NTSC DVD with Myth using PAL as the default TV
     standard).
    
    ---
     mythtv/libs/libmythtv/avformatdecoder.cpp |   25 ++++++++++++++++++-------
     1 file changed, 18 insertions(+), 7 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
    index 7a3996f..74e7743 100644
    a b int AvFormatDecoder::ScanStreams(bool novideo) 
    22442244    {
    22452245        LOG(VB_PLAYBACK, LOG_INFO, LOC +
    22462246            QString("No video track found/selected."));
    2247         QString tvformat = gCoreContext->GetSetting("TVFormat").toLower();
    2248         if (tvformat == "ntsc" || tvformat == "ntsc-jp" ||
    2249             tvformat == "pal-m" || tvformat == "atsc")
     2247
     2248        // Try to use the last know good fps (if it's been set)
     2249        if (m_fps > 0.0f)
    22502250        {
    2251             fps = 29.97;
    2252             m_parent->SetVideoParams(-1, -1, 29.97);
     2251            fps = m_fps;
    22532252        }
    22542253        else
    22552254        {
    2256             fps = 25.0;
    2257             m_parent->SetVideoParams(-1, -1, 25.0);
     2255            // Otherwise set the frame rate based on the TV format set
     2256            // by the user.
     2257            QString tvformat = gCoreContext->GetSetting("TVFormat").toLower();
     2258            if (tvformat == "ntsc" || tvformat == "ntsc-jp" ||
     2259                tvformat == "pal-m" || tvformat == "atsc")
     2260            {
     2261                fps = 29.97;
     2262            }
     2263            else
     2264            {
     2265                fps = 25.0;
     2266            }
    22582267        }
     2268
     2269        m_parent->SetVideoParams(-1, -1, fps);
    22592270    }
    22602271
    22612272    if (m_parent->IsErrored())