Skip to content

Commit 9e0786b

Browse files
author
Mark Kendall
committed
VDPAU: Dummy frames third time lucky.
1 parent 2bfd6f1 commit 9e0786b

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

mythtv/libs/libmythtv/videoout_vdpau.cpp

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,18 @@ void VideoOutputVDPAU::ProcessFrame(VideoFrame *frame, OSD *osd,
390390
ShowPIPs(frame, pipPlayers);
391391
}
392392

393+
void VideoOutputVDPAU::ClearDummyFrame(VideoFrame *frame)
394+
{
395+
if (frame && m_render && !codec_is_std(video_codec_id))
396+
{
397+
struct vdpau_render_state *render =
398+
(struct vdpau_render_state *)frame->buf;
399+
if (render)
400+
m_render->ClearVideoSurface(render->surface);
401+
}
402+
VideoOutput::ClearDummyFrame(frame);
403+
}
404+
393405
void VideoOutputVDPAU::PrepareFrame(VideoFrame *frame, FrameScanType scan,
394406
OSD *osd)
395407
{
@@ -420,7 +432,8 @@ void VideoOutputVDPAU::PrepareFrame(VideoFrame *frame, FrameScanType scan,
420432
}
421433

422434
uint video_surface = m_video_surfaces[0];
423-
bool deint = (m_deinterlacing && m_need_deintrefs && frame);
435+
bool deint = (m_deinterlacing && m_need_deintrefs &&
436+
frame && !dummy);
424437

425438
if (deint)
426439
{
@@ -491,19 +504,16 @@ void VideoOutputVDPAU::PrepareFrame(VideoFrame *frame, FrameScanType scan,
491504
if (size != m_render->GetSize())
492505
LOG(VB_GENERAL, LOG_ERR, LOC + "Unexpected display size.");
493506

494-
if (!dummy)
507+
if (!m_render->MixAndRend(m_video_mixer, field, video_surface, 0,
508+
deint ? &m_reference_frames : NULL,
509+
scan == kScan_Interlaced,
510+
window.GetVideoRect(),
511+
QRect(QPoint(0,0), size),
512+
vsz_enabled ? vsz_desired_display_rect :
513+
window.GetDisplayVideoRect(),
514+
m_pip_ready ? m_pip_layer : 0, 0))
495515
{
496-
if (!m_render->MixAndRend(m_video_mixer, field, video_surface, 0,
497-
deint ? &m_reference_frames : NULL,
498-
scan == kScan_Interlaced,
499-
window.GetVideoRect(),
500-
QRect(QPoint(0,0), size),
501-
vsz_enabled ? vsz_desired_display_rect :
502-
window.GetDisplayVideoRect(),
503-
m_pip_ready ? m_pip_layer : 0, 0))
504-
{
505-
LOG(VB_PLAYBACK, LOG_ERR, LOC + "Prepare frame failed.");
506-
}
516+
LOG(VB_PLAYBACK, LOG_ERR, LOC + "Prepare frame failed.");
507517
}
508518

509519
if (m_visual)

mythtv/libs/libmythtv/videoout_vdpau.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class VideoOutputVDPAU : public VideoOutput
6868
{ return VideoOutput::CanVisualise(audio, m_render); }
6969
virtual bool SetupVisualisation(AudioPlayer *audio, MythRender *render)
7070
{ return VideoOutput::SetupVisualisation(audio, m_render); }
71+
virtual void ClearDummyFrame(VideoFrame* frame);
7172

7273
private:
7374
virtual bool hasFullScreenOSD(void) const { return true; }

0 commit comments

Comments
 (0)