+ int i = 0;
+ QString videopath = path + "_video_" + QString::number(i).rightJustified(4, '0', false) + ".raw";
+ QString audiopath = path + "_audio_" + QString::number(i).rightJustified(4, '0', false) + ".raw";
+ while (QFile::exists(videopath) || QFile::exists(audiopath)) {
+ i++;
+ videopath = path + "_video_" + QString::number(i).rightJustified(4, '0', false) + ".raw";
+ audiopath = path + "_audio_" + QString::number(i).rightJustified(4, '0', false) + ".raw";
+ }
+ videoOutputFile = open(videopath.toUtf8().constData(), O_WRONLY|O_CREAT|O_TRUNC, 0664);
+ if (videoOutputFile < 0)
+ {
+ emit gotMessage(i18n("Could not open video output file %1", videopath));
+ fprintf(stderr, "Could not open video output file \"%s\"\n", videopath.toUtf8().constData());
+ return;
+ }
+ if (KdenliveSettings::hdmicaptureaudio()) {
+ audioOutputFile = open(audiopath.toUtf8().constData(), O_WRONLY|O_CREAT|O_TRUNC, 0664);
+ if (audioOutputFile < 0)
+ {
+ emit gotMessage(i18n("Could not open audio output file %1", audiopath));
+ fprintf(stderr, "Could not open video output file \"%s\"\n", audiopath.toUtf8().constData());
+ return;
+ }
+ }