Skip to content

Commit

Permalink
Audio playbacK: Don't waste memory on video frames for audio
Browse files Browse the repository at this point in the history
- we no longer need video buffers to assist with rendering overlays as
they are all handled by OPenGL
- use zero sized buffers
- always set the frame rate to 23.97 as this should be lower than any
actual display refresh - ensuring we don't wait for video buffers we
don't need
- set reference frames to zero.
  • Loading branch information
mark-kendall committed Dec 19, 2019
1 parent 410b405 commit 244062c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
15 changes: 3 additions & 12 deletions mythtv/libs/libmythtv/decoders/avformatdecoder.cpp
Expand Up @@ -2408,18 +2408,9 @@ int AvFormatDecoder::ScanStreams(bool novideo)
// video params are set properly
if (m_selectedTrack[kTrackTypeVideo].m_av_stream_index == -1)
{
QString tvformat = gCoreContext->GetSetting("TVFormat").toLower();
if (tvformat == "ntsc" || tvformat == "ntsc-jp" ||
tvformat == "pal-m" || tvformat == "atsc")
{
m_fps = 29.97F;
m_parent->SetVideoParams(-1, -1, 29.97, 1.0F, false, 16);
}
else
{
m_fps = 25.0F;
m_parent->SetVideoParams(-1, -1, 25.0, 1.0F, false, 16);
}
m_fps = 23.97F; // minimum likey display refresh rate
// N.B. we know longer need a 'dummy' frame to render overlays into
m_parent->SetVideoParams(0, 0, 23.97, 1.0F, false, 0);
}

if (m_parent->IsErrored())
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -622,7 +622,7 @@ void MythPlayer::SetVideoParams(int width, int height, double fps,
{
bool paramsChanged = ForceUpdate;

if (width >= 1 && height >= 1)
if (width >= 0 && height >= 0)
{
paramsChanged = true;
m_videoDim = m_videoDispDim = QSize(width, height);
Expand Down
9 changes: 0 additions & 9 deletions mythtv/libs/libmythtv/videooutwindow.cpp
Expand Up @@ -113,15 +113,6 @@ void VideoOutWindow::MoveResize(void)
m_videoRect = QRect(QPoint(0, 0), m_videoDispDim);
m_displayVideoRect = m_displayVisibleRect;


// Avoid too small frames for audio only streams (for OSD).
if ((m_videoRect.width() <= 0) || (m_videoRect.height() <= 0))
{
m_videoDispDim = m_displayVisibleRect.size();
m_videoDim = fix_alignment(m_displayVisibleRect.size());
m_videoRect = QRect(QPoint(0, 0), m_videoDim);
}

// Apply various modifications
ApplyDBScaleAndMove();
ApplyLetterboxing();
Expand Down

0 comments on commit 244062c

Please sign in to comment.