From db51ea1ee091aaeef175c43b8fcef6a354bdf714 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Wed, 3 Jul 2019 03:33:52 -0400 Subject: [PATCH] FFmpegUtilities: inline av_make_error_string Avoids warnings about the function being unused, if compiling with `-Wall` Borrowed from: https://github.com/ZoneMinder/zoneminder/blob/222f14523085f996a8d0dd3dd8beea722ea957e1/src/zm_ffmpeg.h#L241 --- include/FFmpegUtilities.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/FFmpegUtilities.h b/include/FFmpegUtilities.h index e3df704b..8a0b7705 100644 --- a/include/FFmpegUtilities.h +++ b/include/FFmpegUtilities.h @@ -91,12 +91,11 @@ #endif // This wraps an unsafe C macro to be C++ compatible function - static const std::string av_make_error_string(int errnum) + inline static const std::string av_make_error_string(int errnum) { char errbuf[AV_ERROR_MAX_STRING_SIZE]; av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); - std::string errstring(errbuf); - return errstring; + return (std::string)errbuf; } // Redefine the C macro to use our new C++ function