ignore pipe error on capture stop - last frame write race condition is harmless if output file has content
This commit is contained in:
@@ -285,9 +285,10 @@ fn compute_output_dims(monitor_w: u32, monitor_h: u32, crop: Option<CaptureRect>
|
|||||||
|
|
||||||
impl CaptureSession {
|
impl CaptureSession {
|
||||||
pub fn stop(self) -> Result<PathBuf> {
|
pub fn stop(self) -> Result<PathBuf> {
|
||||||
self.control
|
// Ignore errors from control.stop() - the last frame write often fails
|
||||||
.stop()
|
// with "pipe is being closed" when stopping. If the output file has content,
|
||||||
.map_err(|e| anyhow!("capture stop: {e}"))?;
|
// the capture was successful.
|
||||||
|
let _ = self.control.stop();
|
||||||
let meta = std::fs::metadata(&self.output_path)
|
let meta = std::fs::metadata(&self.output_path)
|
||||||
.with_context(|| format!("checking output file {}", self.output_path.display()))?;
|
.with_context(|| format!("checking output file {}", self.output_path.display()))?;
|
||||||
if meta.len() == 0 {
|
if meta.len() == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user