summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2010-12-12 14:28:27 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2010-12-14 14:52:34 (GMT)
commit62ffcd3020d59df349acc4021fa7802d1cebaa80 (patch)
treef6930310ebcbe9033b220f76517bc426abd1d6b1
parent373f7b29f59d0f2c56b91d0523fd44bb8442d3e9 (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 198e1fa..c0de97a 100644
--- a/mythtv/libs/libmythtv/mythplayer.cpp
+++ b/mythtv/libs/libmythtv/mythplayer.cpp
@@ -544,15 +544,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();
}
}
@@ -649,6 +647,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,
@@ -662,8 +662,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();
@@ -3180,7 +3178,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 a3b4ced..39074d5 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 4119fb5..e143bee 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(),
@@ -313,8 +313,7 @@ VideoOutput::VideoOutput() :
db_deint_filtername(QString::null),
// 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),
@@ -450,7 +449,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);
}
@@ -1540,7 +1538,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 91de709..112e4f4 100644
--- a/mythtv/libs/libmythtv/videooutbase.h
+++ b/mythtv/libs/libmythtv/videooutbase.h
@@ -288,7 +288,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;