Index: mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
===================================================================
--- mythtv/libs/libmythtv/NuppelVideoPlayer.cpp	(revision 18198)
+++ mythtv/libs/libmythtv/NuppelVideoPlayer.cpp	(working copy)
@@ -650,7 +650,8 @@
             GetDecoder()->GetVideoCodecID(),
             GetDecoder()->GetVideoCodecPrivate(),
             video_disp_dim, video_aspect,
-            widget->winId(), display_rect, 0 /*embedid*/);
+            widget->winId(), display_rect, (video_frame_rate * play_speed), 
+	    0 /*embedid*/);
 
         if (!videoOutput)
         {
@@ -665,7 +666,7 @@
         videoOutput->SetVideoScalingAllowed(db_scale);
 
         // We need to tell it this for automatic deinterlacer settings
-        videoOutput->SetVideoFrameRate(video_frame_rate * play_speed);
+        //videoOutput->SetVideoFrameRate(video_frame_rate * play_speed);
 
         if (videoOutput->hasMCAcceleration() && !decode_extra_audio)
         {
Index: mythtv/libs/libmythtv/videooutbase.cpp
===================================================================
--- mythtv/libs/libmythtv/videooutbase.cpp	(revision 18198)
+++ mythtv/libs/libmythtv/videooutbase.cpp	(working copy)
@@ -67,6 +67,7 @@
         void          *codec_priv,
         const QSize   &video_dim, float        video_aspect,
         WId            win_id,    const QRect &display_rect,
+	float          video_playback_rate,
         WId            embed_id)
 {
     (void) codec_priv;
@@ -172,7 +173,8 @@
             if (vo->Init(
                     video_dim.width(), video_dim.height(), video_aspect,
                     win_id, display_rect.x(), display_rect.y(),
-                    display_rect.width(), display_rect.height(), embed_id))
+                    display_rect.width(), display_rect.height(),
+		    video_playback_rate, embed_id))
             {
                 return vo;
             }
@@ -370,7 +372,8 @@
  * \return true if successful, false otherwise.
  */
 bool VideoOutput::Init(int width, int height, float aspect, WId winid,
-                       int winx, int winy, int winw, int winh, WId embedid)
+                       int winx, int winy, int winw, int winh, 
+		       float prate, WId embedid)
 {
     (void)winid;
     (void)embedid;
@@ -397,6 +400,8 @@
 
     embedding = false;
 
+    SetVideoFrameRate(prate);
+
     return true;
 }
 
@@ -415,6 +420,7 @@
 
 void VideoOutput::SetVideoFrameRate(float playback_fps)
 {
+    video_playback_rate = playback_fps;
     if (db_vdisp_profile)
         db_vdisp_profile->SetOutput(playback_fps);
 }
Index: mythtv/libs/libmythtv/videoout_xv.h
===================================================================
--- mythtv/libs/libmythtv/videoout_xv.h	(revision 18198)
+++ mythtv/libs/libmythtv/videoout_xv.h	(working copy)
@@ -60,7 +60,8 @@
    ~VideoOutputXv();
 
     bool Init(int width, int height, float aspect, WId winid,
-              int winx, int winy, int winw, int winh, WId embedid = 0);
+              int winx, int winy, int winw, int winh, 
+	      float videoPlaybackRate, WId embedid = 0);
 
     bool SetDeinterlacingEnabled(bool);
     bool SetupDeinterlace(bool interlaced, const QString& ovrf="");
Index: mythtv/libs/libmythtv/videoout_xv.cpp
===================================================================
--- mythtv/libs/libmythtv/videoout_xv.cpp	(revision 18198)
+++ mythtv/libs/libmythtv/videoout_xv.cpp	(working copy)
@@ -426,7 +426,7 @@
     if ((width == 1920 || width == 1440) && height == 1088)
         height = 1080; // ATSC 1920x1080
 
-    if (display_res && display_res->SwitchToVideo(width, height))
+    if (display_res && display_res->SwitchToVideo(width, height, (short) roundf(video_playback_rate)))
     {
         // Switching to custom display resolution succeeded
         // Make a note of the new size
@@ -1605,7 +1605,8 @@
  */
 bool VideoOutputXv::Init(
     int width, int height, float aspect,
-    WId winid, int winx, int winy, int winw, int winh, WId embedid)
+    WId winid, int winx, int winy, int winw, int winh, 
+    float prate, WId embedid)
 {
     needrepaint = true;
 
@@ -1662,7 +1663,7 @@
     // Basic setup
     VideoOutput::Init(width, height, aspect,
                       winid, winx, winy, winw, winh,
-                      embedid);
+		      prate, embedid);
 
     // Set resolution/measurements (check XRandR, Xinerama, config settings)
     InitDisplayMeasurements(width, height);
Index: mythtv/libs/libmythtv/videooutbase.h
===================================================================
--- mythtv/libs/libmythtv/videooutbase.h	(revision 18198)
+++ mythtv/libs/libmythtv/videooutbase.h	(working copy)
@@ -40,6 +40,7 @@
         void          *codec_priv,
         const QSize   &video_dim, float        video_aspect,
         WId            win_id,    const QRect &display_rect,
+	float          video_playback_rate,
         WId            embed_id);
 
     VideoOutput();
@@ -47,7 +48,7 @@
 
     virtual bool Init(int width, int height, float aspect,
                       WId winid, int winx, int winy, int winw, 
-                      int winh, WId embedid = 0);
+                      int winh, float video_playback_rate, WId embedid = 0);
     virtual void InitOSD(OSD *osd);
     virtual void SetVideoFrameRate(float);
 
@@ -282,6 +283,7 @@
     QSize   video_dim;        ///< Pixel dimensions of video buffer
     QSize   video_disp_dim;   ///< Pixel dimensions of video display area
     float   video_aspect;     ///< Physical aspect ratio of video
+    float   video_playback_rate;  ///< Playback frame rate of video
 
     /// Normally this is the same as videoAspect, but may not be
     /// if the user has toggled the aspect override mode.
Index: mythtv/libs/libmythui/DisplayRes.cpp
===================================================================
--- mythtv/libs/libmythui/DisplayRes.cpp	(revision 18198)
+++ mythtv/libs/libmythui/DisplayRes.cpp	(working copy)
@@ -40,10 +40,10 @@
     // Initialize GUI mode
     mode[GUI].Init();
     tW = tH = 0;
-    GetMythDB()->GetResolutionSetting("GuiVidMode", tW, tH);
+    GetMythDB()->GetResolutionSetting("GuiVidMode", tW, tH, tAspect, tRate);
     GetDisplaySize(tW_mm, tH_mm);
     GetMythDB()->GetResolutionSetting("DisplaySize", tW_mm, tH_mm);
-    mode[GUI] = DisplayResScreen(tW, tH, tW_mm, tH_mm, -1.0, 0);
+    mode[GUI] = DisplayResScreen(tW, tH, tW_mm, tH_mm, -1.0, tRate);
 
 
     // Initialize default VIDEO mode
@@ -89,6 +89,7 @@
 {
     tmode next_mode = VIDEO; // default VIDEO mode
     DisplayResScreen next = mode[next_mode];
+    next.AddRefreshRate(irate);
 
     // try to find video override mode
     uint key = DisplayResScreen::CalcKey(iwidth, iheight, irate);
@@ -133,7 +134,8 @@
     // need to change video mode?
     short target_rate = 0;
     DisplayResScreen::FindBestMatch(GetVideoModes(), next, target_rate);
-    bool chg = !(next == last) || !(last.RefreshRate() == target_rate);
+    // If GuiVidModeRefreshRate is 0, assume any refresh rate is good enough.
+    bool chg = !(next == last) || (next.RefreshRate() !=0 && !(last.RefreshRate() == target_rate)); 
 
     VERBOSE(VB_PLAYBACK, QString("Trying %1x%2 %3 Hz")
             .arg(next.Width()).arg(next.Height()).arg(target_rate));
Index: mythtv/libs/libmythui/DisplayResScreen.cpp
===================================================================
--- mythtv/libs/libmythui/DisplayResScreen.cpp	(revision 18198)
+++ mythtv/libs/libmythui/DisplayResScreen.cpp	(working copy)
@@ -90,13 +90,20 @@
         if (dsr[i].Width()==d.Width() && dsr[i].Height()==d.Height())
         {
             const vector<short>& rates = dsr[i].RefreshRates();
-            if (rates.size())
+            if (rates.size() && d.RefreshRate() != 0)
             {
-                vector<short>::const_iterator it =
-                    find(rates.begin(), rates.end(), d.RefreshRate());
-                target_rate = (it == rates.end()) ? *(--rates.end()) : *it;
-                return i;
+		for (uint j=0; j < rates.size(); ++j)
+		{
+		    // Multiple of target_rate will do
+		    if (rates[j] % d.RefreshRate() == 0)
+		    {
+			target_rate = rates[j];
+			return i;
+		    }
+		}
+                target_rate = rates[rates.size() - 1];
             }
+	    return i;
         }
     }
     return -1;

