Skip to content

Commit

Permalink
VideoDisplayProfile: Reduce the verbosity of the validity check
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Nov 27, 2019
1 parent 406fc21 commit 8f0e300
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions mythtv/libs/libmythtv/videodisplayprofile.cpp
Expand Up @@ -266,32 +266,23 @@ bool ProfileItem::IsValid(QString *Reason) const
{
if (Reason)
*Reason = "Need a decoder and renderer";

return false;
}

QStringList decoders = VideoDisplayProfile::GetDecoders();
if (!decoders.contains(decoder))
{
if (Reason)
{
*Reason = QString("decoder %1 is not supported (supported: %2)")
.arg(decoder).arg(toCommaList(decoders));
}

*Reason = QString("decoder %1 is not available").arg(decoder);
return false;
}

QStringList renderers = VideoDisplayProfile::GetVideoRenderers(decoder);
if (!renderers.contains(renderer))
{
if (Reason)
{
*Reason = QString("renderer %1 is not supported "
"w/decoder %2 (supported: %3)")
.arg(renderer).arg(decoder).arg(toCommaList(renderers));
}

*Reason = QString("renderer %1 is not supported with decoder %2")
.arg(renderer).arg(decoder);
return false;
}

Expand Down Expand Up @@ -581,8 +572,7 @@ vector<ProfileItem> VideoDisplayProfile::LoadDB(uint GroupId)
if (valid)
list.push_back(tmp);
else
LOG(VB_PLAYBACK, LOG_NOTICE, LOC +
QString("Ignoring profile item %1 (%2)")
LOG(VB_PLAYBACK, LOG_NOTICE, LOC + QString("Ignoring profile %1 (%2)")
.arg(profileid).arg(error));
}
tmp.Clear();
Expand All @@ -598,8 +588,7 @@ vector<ProfileItem> VideoDisplayProfile::LoadDB(uint GroupId)
if (valid)
list.push_back(tmp);
else
LOG(VB_PLAYBACK, LOG_NOTICE, LOC +
QString("Ignoring profile item %1 (%2)")
LOG(VB_PLAYBACK, LOG_NOTICE, LOC + QString("Ignoring profile %1 (%2)")
.arg(profileid).arg(error));
}

Expand Down

0 comments on commit 8f0e300

Please sign in to comment.