1
0
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:
Yuri 2015-07-15 01:46:23 -07:00
parent 49f7a02cbb
commit 0895b89794

View File

@ -104,7 +104,7 @@ CameraDevice* CameraDevice::open(QString devName, VideoMode mode)
} }
AVDictionary* options = nullptr; AVDictionary* options = nullptr;
if (false); if (!iformat);
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
else if (devName.startsWith("x11grab#")) else if (devName.startsWith("x11grab#"))
{ {
@ -255,7 +255,7 @@ QVector<QPair<QString, QString>> CameraDevice::getDeviceList()
if (!getDefaultInputFormat()) if (!getDefaultInputFormat())
return devices; return devices;
if (false); if (!iformat);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
else if (iformat->name == QString("dshow")) else if (iformat->name == QString("dshow"))
devices += DirectShow::getDeviceList(); devices += DirectShow::getDeviceList();
@ -294,7 +294,7 @@ QString CameraDevice::getDefaultDeviceName()
QVector<VideoMode> CameraDevice::getVideoModes(QString devName) QVector<VideoMode> CameraDevice::getVideoModes(QString devName)
{ {
if (false); if (!iformat);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
else if (iformat->name == QString("dshow")) else if (iformat->name == QString("dshow"))
return DirectShow::getDeviceModes(devName); return DirectShow::getDeviceModes(devName);