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

fix(cameradevice): Save string in local variable to avoid errors

This commit is contained in:
Diadlo 2017-10-21 19:59:50 +03:00
parent ecea41045c
commit 92def839d0
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -182,7 +182,8 @@ CameraDevice* CameraDevice::open(QString devName, VideoMode mode)
av_dict_set(&options, "video_size",
QString("%1x%2").arg(mode.width).arg(mode.height).toStdString().c_str(), 0);
av_dict_set(&options, "framerate", QString().setNum(mode.FPS).toStdString().c_str(), 0);
const char* pixel_format = v4l2::getPixelFormatString(mode.pixel_format).toStdString().c_str();
const std::string pixelFormatStr = v4l2::getPixelFormatString(mode.pixel_format).toStdString();
const char* pixel_format = pixelFormatStr.c_str();
if (strncmp(pixel_format, "unknown", 7) != 0) {
av_dict_set(&options, "pixel_format", pixel_format, 0);
}