-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 building against ffmpeg-4.x #28999
Conversation
@@ -576,6 +576,7 @@ SwresamplePointer MakeSwresamplePointer( | |||
if (!result) { | |||
LogError(u"swr_alloc_set_opts"_q); | |||
} | |||
auto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fragile... Wouldn't having AvErrorWrap error;
before ifndef block be better?
@@ -44,7 +44,13 @@ constexpr auto kFrameSize = 4096; | |||
return {}; | |||
} | |||
|
|||
|
|||
#if DA_FFMPEG_NEW_CHANNEL_LAYOUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't correct. This macro is checking for libavutil version to be higher than 57.28.100. av_find_best_stream belongs to libavformat and has changed to the const pointer in 58.79.100 as far as I can see by ffmpeg commit history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e.
#if DA_FFMPEG_NEW_CHANNEL_LAYOUT | |
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 79, 100) |
I have made the changes you suggested. |
Thanks but there's no need to have a separate commit... Can you squash it? |
Ok, it is now squashed into a single commit. |
Thanks! |
Thanks! |
Tested against ffmpeg 4.4.5 and 6.1.2 though there may be versions in between where this breaks. Fixes #28660.