mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(avform): add missing "first" video mode back to video modes
This commit fixes the fact that the selectBestModes() function strips off the first video mode, often a 1080p or 720p mode. Fixes #3588.
This commit is contained in:
parent
0da1a2fd8b
commit
5324e768c3
|
@ -247,12 +247,22 @@ 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user