fix: fix #1457 again by moving av_err2str to a common header (#1688)
Some checks are pending
Build and Release / clang-format (push) Waiting to run
Build and Release / reuse (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:
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

View file

@ -12,6 +12,8 @@ extern "C" {
#include <libswresample/swresample.h>
}
#include "common/support/avdec.h"
namespace Libraries::Ajm {
// Following tables have been reversed from AJM library

View file

@ -18,16 +18,7 @@ extern "C" {
#include <libswscale/swscale.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
#include "common/support/avdec.h"
namespace Libraries::AvPlayer {

View file

@ -7,16 +7,7 @@
#include "common/logging/log.h"
#include "core/libraries/videodec/videodec_error.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
#include "common/support/avdec.h"
namespace Libraries::Vdec2 {

View file

@ -8,16 +8,7 @@
#include "common/logging/log.h"
#include "core/libraries/videodec/videodec_error.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
#include "common/support/avdec.h"
namespace Libraries::Videodec {