aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dvaudio_parser.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-11-17 08:34:35 +0100
committerJames Almer <jamrial@gmail.com>2019-12-31 16:57:37 -0300
commit1cf238d3bfefdfd3345ca262f57e08a798bb0d90 (patch)
tree4586fc542d44b5baae1e999453781e0834579a97 /libavcodec/dvaudio_parser.c
parentcb3a59ca82d070628a4ea12ffa91155328e6a05d (diff)
downloadffmpeg-1cf238d3bfefdfd3345ca262f57e08a798bb0d90.tar.gz
avcodec/cbs: Factor out common code for writing units
All cbs-functions to write units share a common pattern: 1. They check whether they have a write buffer (that is used to store the unit's data until the needed size becomes known after writing the unit when a dedicated buffer will be allocated). 2. They use this buffer for a PutBitContext. 3. The (codec-specific) writing takes place through the PutBitContext. 4. The return value is checked. AVERROR(ENOSPC) here always indicates that the buffer was too small and leads to a reallocation of said buffer. 5. The final buffer will be allocated and the data copied. This commit factors this common code out in a single function in cbs.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit 7c92eaace2b338e0b3acc18e1543b365610578fd)
Diffstat (limited to 'libavcodec/dvaudio_parser.c')
0 files changed, 0 insertions, 0 deletions