[FFmpeg-trac] #5057(undetermined:new): master broke AVCodecContext compatibility with LibAV project
FFmpeg
trac at avcodec.org
Fri Dec 4 13:43:06 CET 2015
#5057: master broke AVCodecContext compatibility with LibAV project
-------------------------------------+-------------------------------------
Reporter: jyavenard | Owner:
Type: defect | Status: new
Priority: normal | Component:
Version: git-master | undetermined
Keywords: | Resolution:
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Comment (by Cigaes):
Replying to [comment:15 jyavenard]:
> We will not be able to create on the heap a AVCodecContext
[[BR]]
You have got a bug, right here.
Applications are not allowed to allocate {{{AVCodecContext}}} themselves.
They have to use the library functions: {{{avcodec_alloc_context3()}}} for
example. The size of {{{AVCodecContext}}} can (and ''does'') change due to
new fields added to the end without notice; if you allocate it using some
kind of {{{malloc(sizeof(AVCodecContext))}}} code, it will be too small
for later versions of the library.
If you allocate using {{{avcodec_alloc_context3()}}} and access the field
using {{{av_opt_set_int()}}} and {{{av_opt_get_int()}}}, your code do not
have to know its exact size.
> get the libAV folks to change those fields so AVCodecContext members
If, after updating your code to fix the API use, you still need that, I
suggest you do just that. But I do not think this is necessary.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5057#comment:18>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list