From cb0fe96e4a06b186fb1c9cf123c6d5a687d701e0 Mon Sep 17 00:00:00 2001 From: emeric Date: Fri, 14 Aug 2020 11:51:03 +0200 Subject: [PATCH] Fixed bad error handling when transcoding. fixes #75 --- src/libs/av/impl/AvTranscoder.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/libs/av/impl/AvTranscoder.cpp b/src/libs/av/impl/AvTranscoder.cpp index 47454837..cf36860e 100644 --- a/src/libs/av/impl/AvTranscoder.cpp +++ b/src/libs/av/impl/AvTranscoder.cpp @@ -199,16 +199,6 @@ Transcoder::process(std::vector& output, std::size_t maxSize) if (!_child || _isComplete) return; - if (_child->out().fail()) - { - LOG(DEBUG) << "Stdout FAILED 2"; - } - - if (_child->out().eof()) - { - LOG(DEBUG) << "Stdout ENDED 2"; - } - output.resize(maxSize); //Read on the output stream @@ -218,14 +208,19 @@ Transcoder::process(std::vector& output, std::size_t maxSize) if (_child->out().fail()) { LOG(DEBUG) << "Stdout FAILED"; + _isComplete = true; } if (_child->out().eof()) { LOG(DEBUG) << "Stdout EOF!"; - _child->clear(); - _isComplete = true; + } + + if (_isComplete) + { + LOG(DEBUG) << "Transcode complete!"; + _child->clear(); _child.reset(); }