libraries/videodec: Fix build errors with av_err2str
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

This commit is contained in:
Daniel R. 2024-11-02 19:11:57 +01:00 committed by GitHub
parent 0b015daff7
commit 29183354cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,17 @@
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
// 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
namespace Libraries::Vdec2 {
std::vector<OrbisVideodec2AvcPictureInfo> gPictureInfos;
@ -225,4 +236,4 @@ AVFrame* VdecDecoder::ConvertNV12Frame(AVFrame& frame) {
return nv12_frame;
}
} // namespace Libraries::Vdec2
} // namespace Libraries::Vdec2