Skip to content

Commit

Permalink
libraries/videodec: Fix build errors with av_err2str
Browse files Browse the repository at this point in the history
  • Loading branch information
polybiusproxy authored Nov 2, 2024
1 parent 0b015da commit 2918335
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/libraries/videodec/videodec2_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -225,4 +236,4 @@ AVFrame* VdecDecoder::ConvertNV12Frame(AVFrame& frame) {
return nv12_frame;
}

} // namespace Libraries::Vdec2
} // namespace Libraries::Vdec2

0 comments on commit 2918335

Please sign in to comment.