Skip to content

Commit

Permalink
MythVideoOutput: Ensure deinterlacers are updated after input change
Browse files Browse the repository at this point in the history
- this is temporary for master and will be re-factored in the near
future

Refs #222
  • Loading branch information
mark-kendall committed Sep 21, 2020
1 parent 4c36f47 commit c405d27
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions mythtv/libs/libmythtv/mythvideoout.cpp
Expand Up @@ -383,13 +383,22 @@ MythDeintType MythVideoOutput::ParseDeinterlacer(const QString& Deinterlacer)

void MythVideoOutput::SetDeinterlacing(bool Enable, bool DoubleRate, MythDeintType Force /*=DEINT_NONE*/)
{


if (!Enable)
{
m_deinterlacing = false;
m_deinterlacing2X = false;
m_forcedDeinterlacer = DEINT_NONE;
m_videoBuffers.SetDeinterlacing(DEINT_NONE, DEINT_NONE, m_videoCodecID);
LOG(VB_PLAYBACK, LOG_INFO, LOC + "Disabled all deinterlacing");
return;
}

m_deinterlacing = Enable;
m_deinterlacing2X = DoubleRate;
m_forcedDeinterlacer = Force;

MythDeintType singlerate = DEINT_NONE;
MythDeintType doublerate = DEINT_NONE;
if (DEINT_NONE != Force)
Expand Down Expand Up @@ -432,6 +441,8 @@ bool MythVideoOutput::InputChanged(const QSize& VideoDim, const QSize& VideoDisp
m_dbDisplayProfile->SetInput(GetVideoDispDim(), 0 ,codecName);
m_videoCodecID = CodecID;
DiscardFrames(true, true);
// Update deinterlacers for any input change
SetDeinterlacing(m_deinterlacing, m_deinterlacing2X, m_forcedDeinterlacer);
return true;
}

Expand Down
3 changes: 3 additions & 0 deletions mythtv/libs/libmythtv/mythvideoout.h
Expand Up @@ -136,6 +136,9 @@ class MythVideoOutput : public MythVideoBounds
MythAVCopy m_copyFrame;
MythDeinterlacer m_deinterlacer;
VideoFrameTypeVec* m_renderFrameTypes { &s_defaultFrameTypes };
bool m_deinterlacing { false };
bool m_deinterlacing2X { false };
MythDeintType m_forcedDeinterlacer { DEINT_NONE };
};

#endif // MYTH_VIDEOOUT_H_
4 changes: 3 additions & 1 deletion mythtv/libs/libmythtv/mythvideooutgpu.cpp
Expand Up @@ -325,7 +325,6 @@ bool MythVideoOutputGPU::ProcessInputChange()
codecName = codec->name;
if (m_dbDisplayProfile)
m_dbDisplayProfile->SetInput(GetVideoDispDim(), 0 , codecName);

bool ok = Init(m_newVideoDim, m_newVideoDispDim, m_newAspect, GetRawWindowRect(), m_newCodecId);
m_newCodecId = kCodec_NONE;
m_newVideoDim = QSize();
Expand All @@ -336,6 +335,9 @@ bool MythVideoOutputGPU::ProcessInputChange()
if (wasembedding && ok)
EmbedInWidget(oldrect);

// Update deinterlacers for any input change
SetDeinterlacing(m_deinterlacing, m_deinterlacing2X, m_forcedDeinterlacer);

if (!ok)
return false;
}
Expand Down
4 changes: 4 additions & 0 deletions mythtv/libs/libmythtv/mythvideooutnull.cpp
Expand Up @@ -199,6 +199,10 @@ void MythVideoOutputNull::SetDeinterlacing(bool Enable, bool DoubleRate, MythDei
MythVideoOutput::SetDeinterlacing(Enable, DoubleRate, Force);
return;
}

m_deinterlacing = false;
m_deinterlacing2X = false;
m_forcedDeinterlacer = DEINT_NONE;
m_videoBuffers.SetDeinterlacing(DEINT_NONE, DEINT_NONE, m_videoCodecID);
}

Expand Down

0 comments on commit c405d27

Please sign in to comment.