• Andreas Rheinhardt's avatar
    avformat/webm_chunk: Use API functions for child muxer · e70c2d02
    Andreas Rheinhardt authored
    instead of calling the write_header/packet/trailer functions directly
    via the function pointers. Also, use distinct AVStreams for the child
    AVFormatContext (up until now the two AVFormatContexts shared their
    AVStreams because allocating their own was deemed too onerous).
    
    Using the function pointers directly meant that the Matroska muxer's
    init-function was never called, because init-functions were only
    introduced a few months after webm_chunk has been added and no one
    thought of/bothered to adapt webm_chunk for this (when the init-function
    was added in b287d7ea, the code setting the timebase was moved to it,
    so that the timebases were no longer set to ms-precision when using
    the webm_chunk muxer; this has been fixed after some time in 42a635dd
    by setting the timebases direcly (instead of calling the init-function)).
    
    And when 982a98a0 added a deinit-function for the Matroska muxer, it
    introduced memleaks in webm_chunk, because the child muxer's internal
    structures were no longer freed when calling write_trailer directly.
    (Given that the init function has never ever been called, the child
    muxer has never ever been properly initialized, so that the
    deinit-function was not called when freeing the child context.)
    
    This commit stops calling the function pointers directly and instead
    uses the standard API functions for muxers. This fixes the above
    mentioned memleaks. (Memleaks are still possible on error. This will be
    fixed in a future commit that adds a deinit-function to webm_chunk
    itself.)
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    e70c2d02
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...