From 45c9ffd08882543ec13d719c2a59a91802b67552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Thu, 5 Jan 2023 08:11:42 -0300 Subject: [PATCH] steamcompmgr: add basic handling of system() ffmpeg call --- src/steamcompmgr.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index 13d314e..8016033 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -2116,9 +2116,15 @@ paint_all(bool async) char cmd[4096]; sprintf(cmd, "ffmpeg -f rawvideo -pixel_format nv12 -video_size %dx%d -i %s %s_encoded.png", pCaptureTexture->width(), pCaptureTexture->height(), pTimeBuffer, pTimeBuffer); - system(cmd); + int ret = system(cmd); - xwm_log.infof("Screenshot saved to %s", pTimeBuffer); + /* Above call may fail, ffmpeg returns 0 on success */ + if (ret) { + xwm_log.infof("Ffmpeg call return status %i", ret); + xwm_log.errorf( "Failed to save screenshot to %s", pTimeBuffer ); + } else { + xwm_log.infof("Screenshot saved to %s", pTimeBuffer); + } } else {