mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-06 09:06:20 +00:00
Redefined ffmpeg's av_err2str macro to be c++ friendly (#815)
* Fixed compiler error for av_err2string by redefining in c++ friendly way * removed link from comment, putting in PR * fixed formatting * Minor fix: enable qt gui to find PKG files with lowercase extension .pkg * Added missing dependencies and instructions for enabling QT for linux builds
This commit is contained in:
parent
9101bd7ad4
commit
96f7a75f38
3 changed files with 21 additions and 7 deletions
|
@ -20,6 +20,17 @@ 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
|
||||
|
||||
namespace Libraries::AvPlayer {
|
||||
|
||||
using namespace Kernel;
|
||||
|
|
|
@ -577,7 +577,7 @@ void MainWindow::SaveWindowState() const {
|
|||
void MainWindow::InstallPkg() {
|
||||
QFileDialog dialog;
|
||||
dialog.setFileMode(QFileDialog::ExistingFiles);
|
||||
dialog.setNameFilter(tr("PKG File (*.PKG)"));
|
||||
dialog.setNameFilter(tr("PKG File (*.PKG *.pkg)"));
|
||||
if (dialog.exec()) {
|
||||
QStringList fileNames = dialog.selectedFiles();
|
||||
int nPkg = fileNames.size();
|
||||
|
@ -949,4 +949,4 @@ void MainWindow::OnLanguageChanged(const std::string& locale) {
|
|||
Config::setEmulatorLanguage(locale);
|
||||
|
||||
LoadTranslation();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue