Skip to content

Commit

Permalink
MythVideoOutput: Ensure we always fallback to opengl for video rendering
Browse files Browse the repository at this point in the history
- this should fix the strange case of all available renderers being
filtered out
- also adds additional logging to try and catch what is happening when
this fallback is required
- the display profile code really needs a re-work - it is overly
complicated
  • Loading branch information
mark-kendall committed Feb 10, 2020
1 parent b7ed92f commit 85f9824
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 20 additions & 1 deletion mythtv/libs/libmythtv/mythvideoout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ MythVideoOutput *MythVideoOutput::Create(const QString &Decoder, MythCodecID
#endif // USING_OPENGL
}

LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Allowed renderers: %1").arg(renderers.join(",")));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Allowed renderers for %1 %2 (Decoder: %3): '%4'")
.arg(get_encoding_type(CodecID)).arg(get_decoder_name(CodecID))
.arg(Decoder).arg(renderers.join(",")));
renderers = VideoDisplayProfile::GetFilteredRenderers(Decoder, renderers);
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Allowed renderers (filt: %1): %2")
.arg(Decoder).arg(renderers.join(",")));
Expand All @@ -87,11 +89,28 @@ MythVideoOutput *MythVideoOutput::Create(const QString &Decoder, MythCodecID
renderer = tmp;
LOG(VB_PLAYBACK, LOG_INFO, LOC + "Preferred renderer: " + renderer);
}
else
{
LOG(VB_PLAYBACK, LOG_INFO, LOC +
QString("No preferred renderer for decoder '%1' - profile renderer: '%2'")
.arg(Decoder).arg(tmp));
}
}

if (renderer.isEmpty())
renderer = VideoDisplayProfile::GetBestVideoRenderer(renderers);

if (renderer.isEmpty() && !(PlayerFlags & kVideoIsNull))
{
QString fallback;
#ifdef USING_OPENGL
fallback = "opengl";
#endif
LOG(VB_GENERAL, LOG_WARNING, LOC + "No renderer found. This should not happen!.");
LOG(VB_GENERAL, LOG_WARNING, LOC + QString("Falling back to '%1'").arg(fallback));
renderer = fallback;
}

while (!renderers.empty())
{
LOG(VB_PLAYBACK, LOG_INFO, LOC +
Expand Down
2 changes: 2 additions & 0 deletions mythtv/libs/libmythtv/videodisplayprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,8 @@ bool VideoDisplayProfile::IsFilterAllowed(const QString &VideoRenderer)
QStringList VideoDisplayProfile::GetFilteredRenderers(const QString &Decoder, const QStringList &Renderers)
{
const QStringList dec_list = GetVideoRenderers(Decoder);
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Safe renderers for '%1': %2")
.arg(Decoder).arg(dec_list.join(",")));
QStringList new_list;

foreach (const auto & dec, dec_list)
Expand Down

0 comments on commit 85f9824

Please sign in to comment.