summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2010-12-12 14:28:27 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2010-12-14 00:21:13 (GMT)
commitfc09367273037a2ffe437048b87fbc4a9a689b53 (patch)
tree962e2f496b3ab563200c4ba382a94287d3f622de
parentf3ddc587a5f0ae87eae0046997a95e55333efc3a (diff)
Fix setting the display refresh rate in live tv.
-rw-r--r--mythtv/libs/libmythtv/mythplayer.cpp10
-rw-r--r--mythtv/libs/libmythtv/videodisplayprofile.h1
-rw-r--r--mythtv/libs/libmythtv/videooutbase.cpp9
-rw-r--r--mythtv/libs/libmythtv/videooutbase.h1
4 files changed, 9 insertions, 12 deletions
diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
index 9171de6..35eae5d 100644
--- a/mythtv/libs/libmythtv/mythplayer.cpp
+++ b/mythtv/libs/libmythtv/mythplayer.cpp
@@ -542,15 +542,13 @@ bool MythPlayer::InitVideo(void)
decoder->GetVideoCodecPrivate(),
pipState,
video_disp_dim, video_aspect,
- widget->winId(), display_rect, (video_frame_rate * play_speed),
+ widget->winId(), display_rect, video_frame_rate,
0 /*embedid*/);
}
if (videoOutput)
{
videoOutput->SetVideoScalingAllowed(true);
- // We need to tell it this for automatic deinterlacer settings
- videoOutput->SetVideoFrameRate(video_frame_rate * play_speed);
CheckExtraAudioDecode();
}
}
@@ -647,6 +645,8 @@ void MythPlayer::ReinitVideo(void)
QMutexLocker locker1(&osdLock);
QMutexLocker locker2(&vidExitLock);
QMutexLocker locker3(&videofiltersLock);
+
+ videoOutput->SetVideoFrameRate(video_frame_rate);
float aspect = (forced_video_aspect > 0) ? forced_video_aspect :
video_aspect;
if (!videoOutput->InputChanged(video_disp_dim, aspect,
@@ -660,8 +660,6 @@ void MythPlayer::ReinitVideo(void)
return;
}
- // We need to tell it this for automatic deinterlacer settings
- videoOutput->SetVideoFrameRate(video_frame_rate * play_speed);
if (osd)
osd->SetPainter(videoOutput->GetOSDPainter());
ReinitOSD();
@@ -3169,7 +3167,7 @@ void MythPlayer::ChangeSpeed(void)
if (videoOutput && videosync)
{
// We need to tell it this for automatic deinterlacer settings
- videoOutput->SetVideoFrameRate(video_frame_rate * play_speed);
+ videoOutput->SetVideoFrameRate(video_frame_rate);
// If using bob deinterlace, turn on or off if we
// changed to or from synchronous playback speed.
diff --git a/mythtv/libs/libmythtv/videodisplayprofile.h b/mythtv/libs/libmythtv/videodisplayprofile.h
index 7bf2447..3735522 100644
--- a/mythtv/libs/libmythtv/videodisplayprofile.h
+++ b/mythtv/libs/libmythtv/videodisplayprofile.h
@@ -85,6 +85,7 @@ class MPUBLIC VideoDisplayProfile
void SetInput(const QSize &size);
void SetOutput(float framerate);
+ float GetOutput(void) { return last_rate; }
void SetVideoRenderer(const QString &video_renderer);
bool CheckVideoRendererGroup(const QString renderer);
diff --git a/mythtv/libs/libmythtv/videooutbase.cpp b/mythtv/libs/libmythtv/videooutbase.cpp
index 031005c..9b9871c 100644
--- a/mythtv/libs/libmythtv/videooutbase.cpp
+++ b/mythtv/libs/libmythtv/videooutbase.cpp
@@ -213,7 +213,7 @@ VideoOutput *VideoOutput::Create(
if (vo)
{
vo->SetPIPState(pipState);
- vo->video_prate = video_prate;
+ vo->SetVideoFrameRate(video_prate);
if (vo->Init(
video_dim.width(), video_dim.height(), video_aspect,
win_id, display_rect.x(), display_rect.y(),
@@ -314,8 +314,7 @@ VideoOutput::VideoOutput() :
db_use_picture_controls(false),
// Video parameters
- video_codec_id(kCodec_NONE),
- db_vdisp_profile(NULL), video_prate(0.0),
+ video_codec_id(kCodec_NONE), db_vdisp_profile(NULL),
// Picture-in-Picture stuff
pip_desired_display_size(160,128), pip_display_size(0,0),
@@ -463,7 +462,6 @@ bool VideoOutput::IsPreferredRenderer(QSize video_size)
void VideoOutput::SetVideoFrameRate(float playback_fps)
{
- video_prate = playback_fps;
if (db_vdisp_profile)
db_vdisp_profile->SetOutput(playback_fps);
}
@@ -1582,7 +1580,8 @@ void VideoOutput::ResizeForVideo(uint width, uint height)
if ((width == 1920 || width == 1440) && height == 1088)
height = 1080; // ATSC 1920x1080
- if (display_res && display_res->SwitchToVideo(width, height, video_prate))
+ float rate = db_vdisp_profile ? db_vdisp_profile->GetOutput() : 0.0f;
+ if (display_res && display_res->SwitchToVideo(width, height, rate))
{
// Switching to custom display resolution succeeded
// Make a note of the new size
diff --git a/mythtv/libs/libmythtv/videooutbase.h b/mythtv/libs/libmythtv/videooutbase.h
index 99737ca..640fe2e 100644
--- a/mythtv/libs/libmythtv/videooutbase.h
+++ b/mythtv/libs/libmythtv/videooutbase.h
@@ -290,7 +290,6 @@ class VideoOutput
// Video parameters
MythCodecID video_codec_id;
VideoDisplayProfile *db_vdisp_profile;
- float video_prate; ///< Playback frame rate of video
// Picture-in-Picture
QSize pip_desired_display_size;