gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.2k stars 481 forks source link

AudioDecoder: support ffmpeg 7.0 #3380

Closed scpeters closed 7 months ago

scpeters commented 7 months ago

🦟 Bug fix

Fixes compilation with ffmpeg 7.0

Summary

Homebrew recently added ffmpeg 7.0, against which gazebo-classic fails to compile (see https://github.com/osrf/homebrew-simulation/pull/2636 and https://github.com/osrf/homebrew-simulation/pull/2637). This uses a portion of the changes from https://github.com/gazebosim/gz-common/pull/329 to fix the reference to the channels variable, and removes some code added in https://github.com/gazebosim/gazebo-classic/pull/3195 by @traversaro with the following comment:

With respect to gazebosim/gz-common#325, I noticed a strange behaviour for which the avcodec_parameters_to_context function that in https://github.com/osrf/gazebo/pull/3195/files#diff-08c8dfc0ffe4733c2fcc1ebd0e3f67032e24b302b25a90c26e87994582503198R326 was not copying the members of the AVCodecParameters structure to the AVCodecContext structure. I was not able to understand why that happened, but copying the members manually worked fine, however it is probably worth to check that the tests work fine on another setup by commenting out https://github.com/osrf/gazebo/pull/3195/files#diff-08c8dfc0ffe4733c2fcc1ebd0e3f67032e24b302b25a90c26e87994582503198R334-R348 .

I removed the mentioned code, and it compiles and all parts of UNIT_AudioDecoder_TEST pass except for CheerFile, which has long been failing.

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.