Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because the FFMpeg developers don't want to break their API by removing their
RSHIFT
definition, and it conflicts with Ruby's definition in their own header files (when building the Ruby bindings), this change jumps through a few hoops to work around the issue locally.In a two-pronged attack, it:
RSHIFT
toFF_RSHIFT
inFFmpegUtilities.h
, after loading the appropriate FFMpeg header files where it's defined.openshot.i
SWIG file to:RSHIFT
toRB_RSHIFT
after it's defined by the Ruby headersRSHIFT
isn't defined after loading the FFMpeg headers, or it renames it toFF_RSHIFT
if it wasRSHIFT
to Ruby's version, from theRB_RSHIFT
macro where it was earlier storedSo, after these changes:
FF_RSHIFT
will be defined everywhere in thelibopenshot
codebaseRSHIFT
andRB_RSHIFT
will have the same definition, matching Ruby'sRSHIFT
RSHIFT
will not be defined outside of the Ruby bindingsWe never actually use either
RSHIFT
anywhere in the code, so this shouldn't affect anything — it's purely to silence compiler warnings (and ensure that we don't accidentally end up using the wrongRSHIFT
in some of our code). The pieces of FFMpeg'slibavcodec
that do use theirRSHIFT
(there are a few codecs) have already been compiled into the library, so they don't rely on the macro definition anymore and won't care that we've#undef
'd it.If we ever want to use FFMpeg's rounding RSHIFT, we just have to remember to call it
FF_RSHIFT
.Fixes #164