mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Prevent crashed when default video format not found.
This commit is contained in:
parent
49f7a02cbb
commit
0895b89794
|
@ -104,7 +104,7 @@ CameraDevice* CameraDevice::open(QString devName, VideoMode mode)
|
|||
}
|
||||
|
||||
AVDictionary* options = nullptr;
|
||||
if (false);
|
||||
if (!iformat);
|
||||
#ifdef Q_OS_LINUX
|
||||
else if (devName.startsWith("x11grab#"))
|
||||
{
|
||||
|
@ -255,7 +255,7 @@ QVector<QPair<QString, QString>> CameraDevice::getDeviceList()
|
|||
if (!getDefaultInputFormat())
|
||||
return devices;
|
||||
|
||||
if (false);
|
||||
if (!iformat);
|
||||
#ifdef Q_OS_WIN
|
||||
else if (iformat->name == QString("dshow"))
|
||||
devices += DirectShow::getDeviceList();
|
||||
|
@ -294,7 +294,7 @@ QString CameraDevice::getDefaultDeviceName()
|
|||
|
||||
QVector<VideoMode> CameraDevice::getVideoModes(QString devName)
|
||||
{
|
||||
if (false);
|
||||
if (!iformat);
|
||||
#ifdef Q_OS_WIN
|
||||
else if (iformat->name == QString("dshow"))
|
||||
return DirectShow::getDeviceModes(devName);
|
||||
|
|
Loading…
Reference in New Issue
Block a user