[mythtv] mythtv-vid branch needs testing

Mark Spieth mark at dclabs.com.au
Mon Aug 13 13:55:12 UTC 2007


>
> And that's an example of the A/V sync code overcompenstating which
> causes stuttering of (alternately) audio & video. Although this is
> a problem which exists in head as well.
>
Im not sure if my logic is correct but in NuppelVideoPlayer.cpp I changed 
the following in HEAD and it seems ok. Im not sure if my logic is correct 
though but I think it is, especially the 2nd part. (patch appended for 
discussion purposes :-)
I think the adjustment is supposed to be based on the output rate (screen 
refresh), not the input rate.
what do you think?
Ive been running this for ages (over a year) and it seems ok when the rates 
are not the same.

mark

@@ -2217,7 +2223,7 @@

             // Display the second field
             videosync->AdvanceTrigger();
-            videosync->WaitForFrame(0);
+            videosync->WaitForFrame(avsync_adjustment);
             if (!resetvideo)
             {
                 videoOutput->Show(ps);
@@ -2245,8 +2251,12 @@
         // If audio is way behind of video, adjust for it...
         // by cutting the frame rate in half for the length of this frame

-        avsync_adjustment = frame_interval;
+        //avsync_adjustment = frame_interval;
+        avsync_adjustment = refreshrate;
         lastsync = true;
         VERBOSE(VB_PLAYBACK, LOC +
                 QString("Video is %1 frames ahead of audio,\n"
                         "\t\t\tdoubling video frame interval to slow 
down.").arg(diverge));
@@ -2255,7 +2265,7 @@



More information about the mythtv-dev mailing list