recorder->output = output;
memset(recorder->frame, 0, size);
- recorder->fd = open(filename,
- O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
-
header.magic = WCAP_HEADER_MAGIC;
switch (output->compositor->read_format) {
return;
}
+ recorder->fd = open(filename,
+ O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
+
+ if (recorder->fd < 0) {
+ weston_log("problem opening output file %s: %m\n", filename);
+ return;
+ }
+
header.width = output->current->width;
header.height = output->current->height;
recorder->total += write(recorder->fd, &header, sizeof header);