From f02bb3b14ab0257a11cb9cde692f87a046c0308b Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Tue, 22 Jun 2010 16:59:08 +1000 Subject: Phonon(qt7); Don't try and display video frames when audio only. Task-number: QTBUG-9068 --- src/3rdparty/phonon/qt7/mediaobject.mm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/3rdparty/phonon/qt7/mediaobject.mm b/src/3rdparty/phonon/qt7/mediaobject.mm index 677640c..ca206bc 100644 --- a/src/3rdparty/phonon/qt7/mediaobject.mm +++ b/src/3rdparty/phonon/qt7/mediaobject.mm @@ -405,20 +405,22 @@ void MediaObject::restartAudioVideoTimers() if (m_audioTimer) killTimer(m_audioTimer); + if (hasVideo()) { #if QT_ALLOW_QUICKTIME // We prefer to use a display link as timer if available, since // it is more steady, and results in better and smoother frame drawing: - startDisplayLink(); - if (!m_displayLink){ + startDisplayLink(); + if (!m_displayLink){ + float fps = m_videoPlayer->staticFps(); + long videoUpdateFrequency = fps ? long(1000.0f / fps) : 0.001; + m_videoTimer = startTimer(videoUpdateFrequency); + } +#else float fps = m_videoPlayer->staticFps(); long videoUpdateFrequency = fps ? long(1000.0f / fps) : 0.001; m_videoTimer = startTimer(videoUpdateFrequency); - } -#else - float fps = m_videoPlayer->staticFps(); - long videoUpdateFrequency = fps ? long(1000.0f / fps) : 0.001; - m_videoTimer = startTimer(videoUpdateFrequency); #endif + } long audioUpdateFrequency = m_audioPlayer->regularTaskFrequency(); m_audioTimer = startTimer(audioUpdateFrequency); -- cgit v0.12