зеркало из https://github.com/mozilla/gecko-dev.git
Bug 804741 - Close our recorder output file handle because recorder dup()s it. r=mwu, a=blocking-basecamp
This commit is contained in:
Родитель
9c6ada9fc9
Коммит
374e3de73e
|
@ -28,6 +28,7 @@
|
||||||
#include "jsapi.h"
|
#include "jsapi.h"
|
||||||
#include "nsThread.h"
|
#include "nsThread.h"
|
||||||
#include <media/MediaProfiles.h>
|
#include <media/MediaProfiles.h>
|
||||||
|
#include "mozilla/FileUtils.h"
|
||||||
#include "nsDirectoryServiceDefs.h" // for NS_GetSpecialDirectory
|
#include "nsDirectoryServiceDefs.h" // for NS_GetSpecialDirectory
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#include "DOMCameraManager.h"
|
#include "DOMCameraManager.h"
|
||||||
|
@ -734,20 +735,17 @@ nsGonkCameraControl::StartRecordingImpl(StartRecordingTask* aStartRecording)
|
||||||
filename->GetNativePath(nativeFilename);
|
filename->GetNativePath(nativeFilename);
|
||||||
DOM_CAMERA_LOGI("Video filename is '%s'\n", nativeFilename.get());
|
DOM_CAMERA_LOGI("Video filename is '%s'\n", nativeFilename.get());
|
||||||
|
|
||||||
int fd = open(nativeFilename.get(), O_RDWR | O_CREAT, 0644);
|
ScopedClose fd(open(nativeFilename.get(), O_RDWR | O_CREAT, 0644));
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
DOM_CAMERA_LOGE("Couldn't create file '%s': (%d) %s\n", nativeFilename.get(), errno, strerror(errno));
|
DOM_CAMERA_LOGE("Couldn't create file '%s': (%d) %s\n", nativeFilename.get(), errno, strerror(errno));
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SetupRecording(fd) != NS_OK) {
|
nsresult rv = SetupRecording(fd);
|
||||||
DOM_CAMERA_LOGE("SetupRecording() failed\n");
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
close(fd);
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
if (mRecorder->start() != OK) {
|
if (mRecorder->start() != OK) {
|
||||||
DOM_CAMERA_LOGE("mRecorder->start() failed\n");
|
DOM_CAMERA_LOGE("mRecorder->start() failed\n");
|
||||||
close(fd);
|
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче