[PR #815] [MERGED] Redefined ffmpeg's av_err2str macro to be c++ friendly #1789

Closed
opened 2026-02-27 21:13:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/815
Author: @zmckevitt
Created: 9/6/2024
Status: Merged
Merged: 9/8/2024
Merged by: @georgemoralis

Base: mainHead: ubuntu24


📝 Commits (5)

  • 577bb66 Fixed compiler error for av_err2string by redefining in c++ friendly way
  • 419d685 removed link from comment, putting in PR
  • 9291b67 fixed formatting
  • 5bb5063 Minor fix: enable qt gui to find PKG files with lowercase extension .pkg
  • 0e48540 Added missing dependencies and instructions for enabling QT for linux builds

📊 Changes

3 files changed (+21 additions, -7 deletions)

View changed files

📝 documents/building-linux.md (+8 -5)
📝 src/core/libraries/avplayer/avplayer_source.cpp (+11 -0)
📝 src/qt_gui/main_window.cpp (+2 -2)

📄 Description

When compiling on Ubuntu 24.04, the definition of av_err2str in externals/ffmpeg-core/include/libavutil/error.h throws a compiler error when attempting to use the macro in a c++ environment (namely src/core/libraries/avplayer/avplayer_source.cpp).

This fix redefines the macro in a 'c++ friendly' manner without modifying the external library and generates no additional compiler warnings in my experience using g++13 or clang18.

More info: https://github.com/joncampbell123/composite-video-simulator/issues/5


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/815 **Author:** [@zmckevitt](https://github.com/zmckevitt) **Created:** 9/6/2024 **Status:** ✅ Merged **Merged:** 9/8/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `ubuntu24` --- ### 📝 Commits (5) - [`577bb66`](https://github.com/shadps4-emu/shadPS4/commit/577bb66c1fdf84c8078a5704f91e934e41374252) Fixed compiler error for av_err2string by redefining in c++ friendly way - [`419d685`](https://github.com/shadps4-emu/shadPS4/commit/419d685394757eed5f770b727350f32bf89a7f02) removed link from comment, putting in PR - [`9291b67`](https://github.com/shadps4-emu/shadPS4/commit/9291b673a00c93f722cba809d6636f9ac7d4a49a) fixed formatting - [`5bb5063`](https://github.com/shadps4-emu/shadPS4/commit/5bb5063480b345ea33713fb5dcbe7c75752e699c) Minor fix: enable qt gui to find PKG files with lowercase extension .pkg - [`0e48540`](https://github.com/shadps4-emu/shadPS4/commit/0e485405105d8df0d6619ca95593f9a00c8ecd38) Added missing dependencies and instructions for enabling QT for linux builds ### 📊 Changes **3 files changed** (+21 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `documents/building-linux.md` (+8 -5) 📝 `src/core/libraries/avplayer/avplayer_source.cpp` (+11 -0) 📝 `src/qt_gui/main_window.cpp` (+2 -2) </details> ### 📄 Description When compiling on Ubuntu 24.04, the definition of ```av_err2str``` in ```externals/ffmpeg-core/include/libavutil/error.h``` throws a compiler error when attempting to use the macro in a c++ environment (namely ```src/core/libraries/avplayer/avplayer_source.cpp```). This fix redefines the macro in a 'c++ friendly' manner without modifying the external library and generates no additional compiler warnings in my experience using g++13 or clang18. More info: https://github.com/joncampbell123/composite-video-simulator/issues/5 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:13:57 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#1789
No description provided.