fix: fix #1457 again by moving av_err2str to a common header (#1688)

This commit is contained in:
Ada Ahmed 2024-12-07 22:52:03 +00:00 committed by GitHub
parent 8ee672fe32
commit dad5953e8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 30 deletions

View file

@ -0,0 +1,17 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
// support header file for libav
// The av_err2str macro in libavutil/error.h does not play nice with C++
#ifdef av_err2str
#undef av_err2str
#include <string>
av_always_inline std::string av_err2string(int errnum) {
char errbuf[AV_ERROR_MAX_STRING_SIZE];
return av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum);
}
#define av_err2str(err) av_err2string(err).c_str()
#endif // av_err2str