From 89acc821d81dabc42f56f6a5190bf613a7ccecb8 Mon Sep 17 00:00:00 2001 From: KurtisVargas Date: Wed, 6 May 2015 21:53:46 -0500 Subject: [PATCH] ffmpeg output parser fix The ffmpeg parser expects '\r' in the output to yield to the caller. For small or fast ffmpeg jobs, ffmpeg never outputs the '\r' so the job is detected as fails. This patch handles the case where a job is finished but never yielded. Seems to not mess with legitimate errors. --- converter/ffmpeg.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/converter/ffmpeg.py b/converter/ffmpeg.py index 03a90a40..42b584b0 100644 --- a/converter/ffmpeg.py +++ b/converter/ffmpeg.py @@ -480,6 +480,10 @@ def on_sigalrm(*_): signal.alarm(0) if not ret: + #For small or very fast jobs, ffmpeg may never output a '\r'. When EOF is reached, yield if we haven't yet. + if not yielded: + yielded = True + yield 10 break try: