[vlc-devel] [PATCH 2/2] vlc_block: store per block ancillary

Denis Charmet typx at dinauz.org
Sat Jul 7 16:32:57 CEST 2018


Hi,

Since this issue is still pending, I've tried to wrap my head around 
the issue.

I see 2 cases where it will leak:
1. The block allocator overriding pf_release
2. The block_Chain functions that don't handle it

But this could be easily fixed in the helpers.

Now out of curiosity I've tried to devise a way to do it out of band to 
compare

The only place where its storage could be easily carried out thoughout 
the different modules would be the es_format_t but:

* The side data are bound to change over time they are not easily 
carried away out of band so what should hold them?

Let's suppose we make es_out_id_t the rightful owner of these data. 
Making sure that the handle is properly carried around with the 
es_format_t copies seems at best risky.

* Demux and packetizer should be able to feed them and associate it 
with blocks while encoders/sout_packetizer might be able to generate 
those kind of side data for the muxer.

* We need to link the side data to the block with some kind of uid. The 
obvious solution would be to use the address of the block itself but 
there could be cases that could happen with stack allocated blocks? So 
to securize that we'd need a new field for this uid.

* When would the out-of-band storage know when to release them? At the 
block release would be the obvious answer but then we still need to 
overload the block_release function to make sure it's done properly.

So maybe my core knowledge is too outdated but I see many more design 
complexities with the out-of-band solution than with block one.

To be fair, I really think that whole concept of generic block has to 
die. Let's call it a frame like lavfc does and fix the cases where it's 
used as something else.

We need to handle side data so short of embedding them inside the block 
data and hope for the best, I don't really see a simple way to do it 
without changing the block_t as we know it.

Regards,
-- 
Denis Charmet - TypX
Le mauvais esprit est un art de vivre


More information about the vlc-devel mailing list