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

FFmpeg: Handle FFmpeg extradata in dedicated class #23182

Merged
merged 1 commit into from
May 12, 2023

Conversation

neo1973
Copy link
Member

@neo1973 neo1973 commented Apr 21, 2023

Description

This ensures that everything is allocated with av_malloc and freed with av_free. The padding is also handled consistently. And as a bonus it's more ergonomic than handling the raw data.

Things to consider for reviewers:

  • Is it a good idea to let FFmpegExtraData throw if allocation fails?

Motivation and context

Mixing the allocation and deallocation methods is very bad, see #23080.

How has this been tested?

Only very light runtime testing so far!

What is the effect on users?

No crashes.

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@neo1973 neo1973 added Type: Fix non-breaking change which fixes an issue Type: Improvement non-breaking change which improves existing functionality WIP PR that is still being worked on labels Apr 21, 2023
@neo1973 neo1973 added this to the Omega 21.0 Alpha 2 milestone Apr 21, 2023
xbmc/cores/FFmpeg.h Outdated Show resolved Hide resolved
xbmc/cores/FFmpeg.h Outdated Show resolved Hide resolved
Copy link
Contributor

@lrusak lrusak left a comment

Choose a reason for hiding this comment

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

Nice change! It really improves the interface and readability.

xbmc/cores/FFmpeg.cpp Show resolved Hide resolved
@neo1973 neo1973 removed the WIP PR that is still being worked on label Apr 22, 2023
@neo1973 neo1973 marked this pull request as ready for review April 22, 2023 14:53
@neo1973 neo1973 requested a review from ksooo as a code owner April 22, 2023 14:53
@jenkins4kodi jenkins4kodi added the Rebase needed PR that does not apply/merge cleanly to current base branch label May 2, 2023
@fritsch
Copy link
Member

fritsch commented May 2, 2023

Please rebase. I hope I can review it during weekend as well. It's a very good approach architecture wise, so I see this as major improvement.

This ensures that everything is allocated with av_malloc and freed with
av_free. The padding is also handled consistently. And as a bonus it's more
ergonomic than handling the raw data.
@jenkins4kodi jenkins4kodi removed the Rebase needed PR that does not apply/merge cleanly to current base branch label May 2, 2023
@enen92 enen92 requested a review from fritsch May 12, 2023 17:24
Copy link
Member

@fritsch fritsch left a comment

Choose a reason for hiding this comment

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

Thanks much! Let's find out if we hit some edge cases.

@neo1973 neo1973 merged commit 7d0690f into xbmc:master May 12, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Fix non-breaking change which fixes an issue Type: Improvement non-breaking change which improves existing functionality v21 Omega
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants