From 8f228d2da7fcc93b18d17a50c653d31d509d3ded Mon Sep 17 00:00:00 2001
From: nyanpasu64 <nyanpasu64@tuta.io>
Date: Sat, 18 Aug 2018 00:04:01 -0700
Subject: [PATCH] [PipeOutput] Combine all return codes from pipeline.

This allows the caller to detect whether intermediate commands (eg.
ffmpeg | ffplay) failed.
---
 ovgenpy/outputs.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ovgenpy/outputs.py b/ovgenpy/outputs.py
index ee52e8e..9600336 100644
--- a/ovgenpy/outputs.py
+++ b/ovgenpy/outputs.py
@@ -108,9 +108,9 @@ class PipeOutput(Output):
     def close(self) -> int:
         self._stream.close()
 
-        retval = None
+        retval = 0
         for popen in self._pipeline:
-            retval = popen.wait()
+            retval |= popen.wait()
         return retval   # final value
 
     def __exit__(self, exc_type, exc_val, exc_tb):