• Andreas Rheinhardt's avatar
    cbs: Allow non-blank packets in ff_cbs_write_packet · 1e93f506
    Andreas Rheinhardt authored
    Up until now, ff_cbs_write_packet always initialized the packet
    structure it received without documenting this behaviour; furthermore,
    the packet's buffer would (on success) be overwritten with the new
    buffer without unreferencing the old. This meant that the input packet
    had to be either clean (otherwise there would be memleaks) in which case
    the initialization is redundant or uninitialized. ff_cbs_write_packet
    was never used with uninitialized packets, so the initialization was
    redundant. Worse yet, it forced callers to use more than one packet and
    made it difficult to add side-data to a packet designated for output,
    because said side-data could only be attached after the call to
    ff_cbs_write_packet.
    
    This has been changed. It is now allowed to use a non-blank packet.
    The currently existing buffer will be unreferenced and replaced by
    the new one, as will be the accompanying fields (i.e. data and size).
    The rest isn't touched at all.
    
    This change will enable us to use only one packet in the bitstream
    filters that rely on CBS.
    
    This commit also updates the documentation of ff_cbs_write_extradata
    and ff_cbs_write_packet (to better describe existing behaviour and in
    the latter case to also describe the new behaviour).
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    1e93f506
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...
.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...