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 deprecation warnings #603

Merged
merged 3 commits into from
May 7, 2024
Merged

Conversation

azeey
Copy link
Contributor

@azeey azeey commented May 3, 2024

🦟 Bug fix

Summary

Fix deprecation warnings:

  • Replace avcodec_close with avcodec_free_context
  • Suppress deprecation of std::iterator since we can't change it without breaking ABI. I only did this for macOS, since that's the only platform that emits the warning.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

Signed-off-by: Addisu Z. Taddese <[email protected]>
@azeey azeey requested a review from marcoag as a code owner May 3, 2024 20:46
@github-actions github-actions bot added the 🏰 citadel Ignition Citadel label May 3, 2024
Signed-off-by: Addisu Z. Taddese <[email protected]>
@@ -67,7 +67,7 @@ void AudioDecoder::Cleanup()
{
// Close the codec
if (this->data->codecCtx)
avcodec_close(this->data->codecCtx);
avcodec_free_context(&this->data->codecCtx);
Copy link
Member

Choose a reason for hiding this comment

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

this change causes a test failure on 20.04; perhaps we can ifdef on the software version if we can figure out the difference in the version variables between 20.04 and 22.04?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't do much investigation into whether we can simply replace avcodec_close with avcodec_free_context, but let me try it on a newer version of Ubuntu to see if it fails everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at this more closely, I think it's more about how codecCtx was created in the first place. In d38e4d3, I've used avcodec_free_context if codeCtx was created using avcodec_alloc_context3, which is inline with the ffmpeg documentation

@mjcarroll mjcarroll merged commit ac3fd97 into gazebosim:ign-common3 May 7, 2024
8 checks passed
@azeey azeey deleted the fix_warnings branch May 7, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants