Skip to content

Commit

Permalink
Fix setting the display refresh rate in live tv.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Kendall authored and jyavenard committed Dec 14, 2010
1 parent 373f7b2 commit 62ffcd3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
10 changes: 4 additions & 6 deletions mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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,
Expand All @@ -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();
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/videodisplayprofile.h
Expand Up @@ -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);
Expand Down
9 changes: 4 additions & 5 deletions mythtv/libs/libmythtv/videooutbase.cpp
Expand Up @@ -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(),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/videooutbase.h
Expand Up @@ -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;
Expand Down

0 comments on commit 62ffcd3

Please sign in to comment.