Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(cameradevice): Save string in local variable to avoid errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Diadlo committed Oct 23, 2017
1 parent ecea410 commit 92def83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/cameradevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 92def83

Please sign in to comment.