1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #3589

initramfs (2):
      fix(avform): add missing "first" video mode back to video modes
      fix(avform): display true video height in video mode selection
This commit is contained in:
Zetok Zalbavar 2016-08-07 20:26:57 +01:00
commit a446294ea8
No known key found for this signature in database
GPG Key ID: C953D3880212068A

View File

@ -247,12 +247,20 @@ void AVForm::selectBestModes(QVector<VideoMode> &allVideoModes)
for (auto it = bestModeInds.rbegin(); it != bestModeInds.rend(); ++it)
{
VideoMode mode = allVideoModes[it->second];
int size = getModeSize(mode);
auto result = std::find_if(newVideoModes.cbegin(), newVideoModes.cend(),
[size](VideoMode mode) { return getModeSize(mode) == size; });
if (result == newVideoModes.end())
if (newVideoModes.empty())
{
newVideoModes.push_back(mode);
}
else
{
int size = getModeSize(mode);
auto result = std::find_if(newVideoModes.cbegin(), newVideoModes.cend(),
[size](VideoMode mode) { return getModeSize(mode) == size; });
if (result == newVideoModes.end())
newVideoModes.push_back(mode);
}
}
allVideoModes = newVideoModes;
}
@ -271,7 +279,7 @@ void AVForm::fillCameraModesComboBox()
qDebug("width: %d, height: %d, FPS: %f, pixel format: %s\n", mode.width, mode.height, mode.FPS, pixelFormat.toStdString().c_str());
if (mode.height && mode.width)
str += QString("%1p").arg(getModeSize(mode));
str += QString("%1p").arg(mode.height);
else
str += tr("Default resolution");