mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 804741 - close our recorder output file handle because recorder dup()s it. r=mwu
This commit is contained in:
parent
f2f61487b3
commit
ff87bb2f7d
@ -28,6 +28,7 @@
|
||||
#include "jsapi.h"
|
||||
#include "nsThread.h"
|
||||
#include <media/MediaProfiles.h>
|
||||
#include "mozilla/FileUtils.h"
|
||||
#include "nsDirectoryServiceDefs.h" // for NS_GetSpecialDirectory
|
||||
#include "nsPrintfCString.h"
|
||||
#include "DOMCameraManager.h"
|
||||
@ -734,20 +735,17 @@ nsGonkCameraControl::StartRecordingImpl(StartRecordingTask* aStartRecording)
|
||||
filename->GetNativePath(nativeFilename);
|
||||
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) {
|
||||
DOM_CAMERA_LOGE("Couldn't create file '%s': (%d) %s\n", nativeFilename.get(), errno, strerror(errno));
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (SetupRecording(fd) != NS_OK) {
|
||||
DOM_CAMERA_LOGE("SetupRecording() failed\n");
|
||||
close(fd);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsresult rv = SetupRecording(fd);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (mRecorder->start() != OK) {
|
||||
DOM_CAMERA_LOGE("mRecorder->start() failed\n");
|
||||
close(fd);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user