Am 03.09.2015 um 13:52 schrieb Gerd Hoffmann:
   Hi,

Beside that I think it makes sense to have the shrinking logic in
buffer_reserve too so we don't have to add buffer_shrink calls all over
the place.
We need a possibility to shrink the buffer after it has been used.
Especially the queue->buffer.
That works fine.  Test patch attached.

Not completely. queue->buffer may remain big, if you disconnect in the
wrong moment. Maybe there should be a buffer_free if the last client
disconnects?

In general I like your modified patch because the shrinking is slower than
in my version. for 64*1024 you should introduce a macro.


I'm not sure this is the way to go though.  I see alot of growing and
shrinking.  We also do alot of coping (each realloc, but also from
buffer to buffer).

We might be better off redoing the whole buffer management, at least
once we are done with encoding one frame.  Passing on a *pointer* to the
buffer, once sent to the wire just free the buffer.  Allocate a new one
for the next frame.  That way we copy around less data and also don't
have to worry about big unused buffers in the first place ...

Maybe this should be the permanent solution.

Peter

Reply via email to