commit 17bb6963d89423fe6c0d591f8cf309b62f299354
Author: Mark Spieth <mspieth@digivation.com.au>
Date:   Sat Aug 29 21:52:40 2009 +1000

    smoother video sync so tickers scroll smoothly at any speed

diff --git a/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp b/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
index dedfe0f..1d0f905 100644
--- a/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
+++ b/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
@@ -26,6 +26,8 @@ using namespace std;
 #include <QKeyEvent>
 #include <QDir>
 
+#define NEW_AVSYNC
+
 // MythTV headers
 #include "mythconfig.h"
 #include "mythdbcon.h"
@@ -2491,11 +2493,12 @@ void NuppelVideoPlayer::AVSync(void)
             // the vertical sync (e.g. VDPAU)
             videoOutput->PrepareFrame(buffer, kScan_Intr2ndField);
             videoOutput->Show(kScan_Intr2ndField);
-            VERBOSE(VB_PLAYBACK, LOC + dbg + "skipping A/V wait.");
+            VERBOSE(VB_PLAYBACK|VB_TIMESTAMP, LOC + dbg + "skipping A/V wait.");
         }
         else
         {
             // If we are using software decoding, skip this frame altogether.
+            //VERBOSE(VB_PLAYBACK|VB_TIMESTAMP, LOC + dbg + "dropping frame.");
             VERBOSE(VB_PLAYBACK, LOC + dbg + "dropping frame to catch up.");
         }
     }
@@ -2505,7 +2508,9 @@ void NuppelVideoPlayer::AVSync(void)
         if (buffer)
             videoOutput->PrepareFrame(buffer, ps);
 
+        VERBOSE(VB_PLAYBACK|VB_TIMESTAMP, QString("AVSync waitforframe %1 %2").arg(avsync_adjustment).arg(m_double_framerate));
         videosync->WaitForFrame(avsync_adjustment);
+        VERBOSE(VB_PLAYBACK|VB_TIMESTAMP, "AVSync show");
         if (!resetvideo)
             videoOutput->Show(ps);
 
@@ -2546,7 +2551,11 @@ void NuppelVideoPlayer::AVSync(void)
 
             // Display the second field
             videosync->AdvanceTrigger();
+#ifdef NEW_AVSYNC
+            videosync->WaitForFrame(avsync_adjustment);
+#else
             videosync->WaitForFrame(0);
+#endif
             if (!resetvideo)
             {
                 videoOutput->Show(ps);
@@ -2574,7 +2583,11 @@ void NuppelVideoPlayer::AVSync(void)
         // If audio is way behind of video, adjust for it...
         // by cutting the frame rate in half for the length of this frame
 
+#ifdef NEW_AVSYNC
+        avsync_adjustment = refreshrate;
+#else
         avsync_adjustment = frame_interval;
+#endif
         lastsync = true;
         VERBOSE(VB_PLAYBACK, LOC +
                 QString("Video is %1 frames ahead of audio,\n"
