diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index 2489b9c63..84070a4af 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -177,60 +177,38 @@ void ATVMod::modulateSample() void ATVMod::pullVideo(Real& sample) { - if (m_interlaced) - { - int iLine = m_lineCount % m_nbLines2; + int iLine = m_lineCount % m_nbLines2; - if (m_lineCount < m_nbLines2) // even image - { - if (iLine < m_nbSyncLinesHead) - { - pullVSyncLine(sample); - } - else if (iLine < m_nbSyncLinesHead + m_nbBlankLines) - { - pullVSyncLine(sample); // pull black line - } - else if (iLine < m_nbLines2 - 3) - { - pullImageLine(sample); - } - else - { - pullVSyncLine(sample); - } - } - else // odd image - { - if (iLine < m_nbSyncLinesHead - 1) - { - pullVSyncLine(sample); - } - else if (iLine < m_nbSyncLinesHead + m_nbBlankLines - 1) - { - pullVSyncLine(sample); // pull black line - } - else if (iLine < m_nbLines2 - 4) - { - pullImageLine(sample); - } - else - { - pullVSyncLine(sample); - } - } - } - else // non interlaced + if (m_lineCount < m_nbLines2) // even image or non interlaced { - if (m_lineCount < m_nbSyncLinesHead) + if (iLine < m_nbSyncLinesHead) { pullVSyncLine(sample); } - else if (m_lineCount < m_nbSyncLinesHead + m_nbBlankLines) + else if (iLine < m_nbSyncLinesHead + m_nbBlankLines) { pullVSyncLine(sample); // pull black line } - else if (m_lineCount < m_nbLines - 3) + else if (iLine < m_nbLines2 - 3) + { + pullImageLine(sample); + } + else + { + pullVSyncLine(sample); + } + } + else // odd image + { + if (iLine < m_nbSyncLinesHead - 1) + { + pullVSyncLine(sample); + } + else if (iLine < m_nbSyncLinesHead + m_nbBlankLines - 1) + { + pullVSyncLine(sample); // pull black line + } + else if (iLine < m_nbLines2 - 4) { pullImageLine(sample); } @@ -238,7 +216,6 @@ void ATVMod::pullVideo(Real& sample) { pullVSyncLine(sample); } - } if (m_horizontalCount < m_nbHorizPoints - 1) diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h index c6d968463..0cae0b8ec 100644 --- a/plugins/channeltx/modatv/atvmod.h +++ b/plugins/channeltx/modatv/atvmod.h @@ -526,7 +526,7 @@ private: sample = ((iLine -5) / (float) m_nbImageLines2) * m_spanLevel + m_blackLevel; break; case ATVModInputImage: - if (!m_imageOK || (iLineImage < 0) || m_image.empty()) + if (!m_imageOK || (iLineImage < -oddity) || m_image.empty()) { sample = m_spanLevel * m_running.m_uniformLevel + m_blackLevel; } @@ -544,7 +544,7 @@ private: } break; case ATVModInputVideo: - if (!m_videoOK || (iLineImage < 0) || m_videoFrame.empty()) + if (!m_videoOK || (iLineImage < -oddity) || m_videoFrame.empty()) { sample = m_spanLevel * m_running.m_uniformLevel + m_blackLevel; } @@ -562,7 +562,7 @@ private: } break; case ATVModInputCamera: - if ((iLineImage < 0) || (m_cameraIndex < 0)) + if ((iLineImage < -oddity) || (m_cameraIndex < 0)) { sample = m_spanLevel * m_running.m_uniformLevel + m_blackLevel; }