-
Notifications
You must be signed in to change notification settings - Fork 229
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 compiler error on Mac of missing endian.h #54
base: master
Are you sure you want to change the base?
Conversation
Libav[1] has change the function avcodec_alloc_frame to av_frame_alloc. This fix is required to build untrunc with latest libav [1]https://patches.libav.org/patch/44214/
Fix deprecated libav function on MacOS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the huge delay, I have removed the endian.h dependency and updated the avcodec api.
Would you mind gettin gthe latest version so I can merge the docs?
Hi! To get it compiled, i commented the includes for endian.h. Also i have to reference CoreFoundation and CoreVideo to fix some symbol references. This is the command line i've used on OSX 10.12.6
|
Hi, was the dependency on endian.h really removed? I still have to "sed -i.orig -e's:endian.h:machine/endian.h:' *cpp" to make it compile. |
Hi, I get the track.cpp:46:10: fatal error: 'config.h' file not found after solving the endian.h dependency with mike402's "sed -i.orig -e's:endian.h:machine/endian.h:' *cpp". Here is my folder for reference and fixing. https://drive.google.com/open?id=11Jr-KXLXR8y3AITcIKdW4CuwUj__ShIf Used jmoleiro's suggestion for the compile command. track.cpp:30:9: warning: '__STDC_LIMIT_MACROS' macro redefined define __STDC_LIMIT_MACROS
track.cpp:31:9: warning: '__STDC_CONSTANT_MACROS' macro redefined define __STDC_CONSTANT_MACROS
track.cpp:46:10: fatal error: 'config.h' file not found define __STDC_LIMIT_MACROS
mp4.cpp:26:9: warning: '__STDC_CONSTANT_MACROS' macro redefined define __STDC_CONSTANT_MACROS
mp4.cpp:71:2: warning: 'av_register_all' is deprecated define attribute_deprecated attribute((deprecated))
mp4.cpp:285:46: warning: 'codec' is deprecated [-Wdeprecated-declarations] define attribute_deprecated attribute((deprecated)) |
Yeah -definitely not working on Mac anymore. track.cpp:197:12: error: out-of-line definition of 'getLength' does not match any declaration in 'Codec' track.cpp:385:59: error: no member named 'codec_name' in 'AVCodecContext' among a slew of warnings. |
Originally if you compile untrunc on mac, you'll get
track.cpp:28:10: fatal error: 'endian.h' file not found
. But even if you switch to<machine/endian.h>
, it'll still complain aboutfile.cpp:74:12: error: use of undeclared identifier 'be32toh'
.So solution is to provide
be32toh
withOSSwapBigToHostInt32
, and so on. For windows we might have to implement ourselves but I'll leave it to someone really needs windows support to implement this.