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

Use aligned_malloc when using buffers with sws_scale #9623

Merged
merged 3 commits into from Apr 14, 2016

Conversation

Projects
None yet
3 participants
@fritsch
Copy link
Member

commented Apr 14, 2016

Since ffmpeg 3 we heavily segfault under certain conditions as ffmpeg sometimes asumes 16 byte aligned memory adresses, which are normally guaranteed when using ffmpeg's alloc methods. As we supply external buffers we need to take great care.

Let's see which includes are missing for Windows, OSX and so on.

Edit: To add, I talked with the ffmpeg guys and they highly, highly suggest to use proper alignment as it will be totally slow when not doing so.

@fritsch

This comment has been minimized.

Copy link
Member Author

commented Apr 14, 2016

@afedchin please verify WinRenderer.cpp as the memory comes from "somewhere" else.

The first commit fixes, e.g. this: http://forum.kodi.tv/showthread.php?tid=269232

@fritsch

This comment has been minimized.

Copy link
Member Author

commented Apr 14, 2016

jenkins build this please to see which includes are still missing

@fritsch

This comment has been minimized.

Copy link
Member Author

commented Apr 14, 2016

@FernetMenta should we use av_malloc / av_free instead to be on the safe side for the future? At least in the above touched files we have a dependency to av_malloc anyways?

@FernetMenta

This comment has been minimized.

Copy link
Member

commented Apr 14, 2016

meh, this crappy ms function spread over the app like cancer. Defining a Windows function for the other platforms is rather hacky and usage of this should not continue.
Why don't you define a function for all platforms with maybe different implementations. Saves a lot of those ugly ifdefs in the include section.

@fritsch fritsch force-pushed the fritsch:alignedmalloc branch from 3c4f275 to d71d354 Apr 14, 2016

@fritsch fritsch force-pushed the fritsch:alignedmalloc branch from d71d354 to 74fc615 Apr 14, 2016

@fritsch fritsch force-pushed the fritsch:alignedmalloc branch from 74fc615 to 21f7dda Apr 14, 2016

@fritsch

This comment has been minimized.

Copy link
Member Author

commented Apr 14, 2016

Yeah ... in this concrete case ... we can just use av_malloc as we have the dependency to sws_scale anyways ...

@fritsch

This comment has been minimized.

Copy link
Member Author

commented Apr 14, 2016

jenkins build this please with our new and shiny av_malloc / av_free usage

@fritsch

This comment has been minimized.

Copy link
Member Author

commented Apr 14, 2016

Acked by @FernetMenta via slack.

@fritsch fritsch merged commit 02411f9 into xbmc:master Apr 14, 2016

2 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
default Merged build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.