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 committed Dec 12, 2010
1 parent 18f92f5 commit 3396a46
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(), decoder->GetVideoCodecPrivate(),
pipState, pipState,
video_disp_dim, video_aspect, video_disp_dim, video_aspect,
widget->winId(), display_rect, (video_frame_rate * play_speed), widget->winId(), display_rect, video_frame_rate,
0 /*embedid*/); 0 /*embedid*/);
} }


if (videoOutput) if (videoOutput)
{ {
videoOutput->SetVideoScalingAllowed(true); videoOutput->SetVideoScalingAllowed(true);
// We need to tell it this for automatic deinterlacer settings
videoOutput->SetVideoFrameRate(video_frame_rate * play_speed);
CheckExtraAudioDecode(); CheckExtraAudioDecode();
} }
} }
Expand Down Expand Up @@ -649,6 +647,8 @@ void MythPlayer::ReinitVideo(void)
QMutexLocker locker1(&osdLock); QMutexLocker locker1(&osdLock);
QMutexLocker locker2(&vidExitLock); QMutexLocker locker2(&vidExitLock);
QMutexLocker locker3(&videofiltersLock); QMutexLocker locker3(&videofiltersLock);

videoOutput->SetVideoFrameRate(video_frame_rate);
float aspect = (forced_video_aspect > 0) ? forced_video_aspect : float aspect = (forced_video_aspect > 0) ? forced_video_aspect :
video_aspect; video_aspect;
if (!videoOutput->InputChanged(video_disp_dim, aspect, if (!videoOutput->InputChanged(video_disp_dim, aspect,
Expand All @@ -662,8 +662,6 @@ void MythPlayer::ReinitVideo(void)
return; return;
} }


// We need to tell it this for automatic deinterlacer settings
videoOutput->SetVideoFrameRate(video_frame_rate * play_speed);
if (osd) if (osd)
osd->SetPainter(videoOutput->GetOSDPainter()); osd->SetPainter(videoOutput->GetOSDPainter());
ReinitOSD(); ReinitOSD();
Expand Down Expand Up @@ -3180,7 +3178,7 @@ void MythPlayer::ChangeSpeed(void)
if (videoOutput && videosync) if (videoOutput && videosync)
{ {
// We need to tell it this for automatic deinterlacer settings // 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 // If using bob deinterlace, turn on or off if we
// changed to or from synchronous playback speed. // 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 SetInput(const QSize &size);
void SetOutput(float framerate); void SetOutput(float framerate);
float GetOutput(void) { return last_rate; }


void SetVideoRenderer(const QString &video_renderer); void SetVideoRenderer(const QString &video_renderer);
bool CheckVideoRendererGroup(const QString 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) if (vo)
{ {
vo->SetPIPState(pipState); vo->SetPIPState(pipState);
vo->video_prate = video_prate; vo->SetVideoFrameRate(video_prate);
if (vo->Init( if (vo->Init(
video_dim.width(), video_dim.height(), video_aspect, video_dim.width(), video_dim.height(), video_aspect,
win_id, display_rect.x(), display_rect.y(), win_id, display_rect.x(), display_rect.y(),
Expand Down Expand Up @@ -313,8 +313,7 @@ VideoOutput::VideoOutput() :
db_deint_filtername(QString::null), db_deint_filtername(QString::null),


// Video parameters // Video parameters
video_codec_id(kCodec_NONE), video_codec_id(kCodec_NONE), db_vdisp_profile(NULL),
db_vdisp_profile(NULL), video_prate(0.0),


// Picture-in-Picture stuff // Picture-in-Picture stuff
pip_desired_display_size(160,128), pip_display_size(0,0), 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) void VideoOutput::SetVideoFrameRate(float playback_fps)
{ {
video_prate = playback_fps;
if (db_vdisp_profile) if (db_vdisp_profile)
db_vdisp_profile->SetOutput(playback_fps); 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) if ((width == 1920 || width == 1440) && height == 1088)
height = 1080; // ATSC 1920x1080 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 // Switching to custom display resolution succeeded
// Make a note of the new size // 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 // Video parameters
MythCodecID video_codec_id; MythCodecID video_codec_id;
VideoDisplayProfile *db_vdisp_profile; VideoDisplayProfile *db_vdisp_profile;
float video_prate; ///< Playback frame rate of video


// Picture-in-Picture // Picture-in-Picture
QSize pip_desired_display_size; QSize pip_desired_display_size;
Expand Down

0 comments on commit 3396a46

Please sign in to comment.