summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-29 13:47:05 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-30 03:10:27 -0800
commit3d367e009c22e390c021bd6b2be32adc641222e7 (patch)
treebd9cbd71e9dcf73a7d4acc88b4bdbdb430c87e43 /demux/demux.h
parent0366ba253159a551127a7d1817a4a000e078d322 (diff)
downloadmpv-3d367e009c22e390c021bd6b2be32adc641222e7.tar.bz2
mpv-3d367e009c22e390c021bd6b2be32adc641222e7.tar.xz
mp_image: factor buffer referencing
Reduce the trivial but still annoying code duplication in mp_image_new_ref(), which has to create new buffer references and deal with possible failure of creating them. The tricky part is that if creating a reference fails, we must set the target to NULL, so that unreferencing the failed new mp_image reference does not release the buffer references of the original mp_image. For the same reason, the code can't jump to error handling when it can't create a new reference, and has to set a flag instead.
Diffstat (limited to 'demux/demux.h')
0 files changed, 0 insertions, 0 deletions