Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ffmpeg v5 build #2543

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions examples/ffmpeg-transcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ static int decode_audio(struct audio_buffer *audio_buf, s16 **data, int *size)
const size_t errbuffsize = 1024;
char errbuff[errbuffsize];

av_register_all(); // from avformat. Still a must-have call for ffmpeg v3! (can be skipped for later versions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naive and bad modif: breaks the ffmpeg v3 build.
Proper modif should have been:
#ifdef FFMPEG_VERSION < 5
av_register_all();
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want this to happen just do a PR with:

#ifdef FFMPEG_VERSION < 4
av_register_all();
#endif

In anyway this is an example for the current state and meant to be simple.

I find the tone quite harsh and not inviting for help.
The caveat for ffmpeg 3.0 was clearly mentioned in the description though.
The call is deprecated since ffmpeg 4.0 in 2018.


fmt_ctx = avformat_alloc_context();
avio_ctx_buffer = (u8*)av_malloc(AVIO_CTX_BUF_SZ);
LOG("Creating an avio context: AVIO_CTX_BUF_SZ=%d\n", AVIO_CTX_BUF_SZ);
Expand Down
Loading