diff options
author | Reinhard Nißl <rnissl@gmx.de> | 2011-02-06 19:29:20 +0100 |
---|---|---|
committer | Reinhard Nißl <rnissl@gmx.de> | 2011-02-06 19:29:20 +0100 |
commit | 498ee00acbfe74a6cdcf52edca245541f42be996 (patch) | |
tree | cd496be6a9e968741129397b5d3b0a6d455c696f /m4 | |
parent | abd4a7afb8d297fba1b81cb258044227cb3e5f77 (diff) | |
download | xine-lib-498ee00acbfe74a6cdcf52edca245541f42be996.tar.gz xine-lib-498ee00acbfe74a6cdcf52edca245541f42be996.tar.bz2 |
Fix argb_layer handling in xine-libs OSD stack.
xine-libs OSD stack is event driven and some memory blocks are not copied
but responsibility to free the memory moves to different layers of the
OSD stack.
When argb_layer was introduced, this behavior was not taken into account
and as such it is likely that for example osd_free_object() frees the
argb_layer while vdpau_overlay_* functions still access the memory.
Passing responsibility for the argb_layer is not that easy as it seems as
the design goal of the argb_layer was to not duplicate any memory of the
argb_buffer which all other OSD functions usually do.
To solve this issue, argb_layer_t will be turned into a managed data
structure by introducing a ref_count member. ref_count increases as more
layers of the OSD stack hold a reference to that memory block, and it
decreases when they are no longer interested in it. When ref_count reaches
zero the memory block is freed automatically. To deal with ref counting,
set_argb_layer_ptr() has been introduced.
Some functions of the OSD layers had to be modified to deal with reference
tracking. For convinience, osd_free_object() should clear the argb_buffer
pointer so that the buffer may be freed safely after returning.
Diffstat (limited to 'm4')
0 files changed, 0 insertions, 0 deletions