[FFmpeg-devel] [GSOC] Handling slave failure in tee muxer

sebechlebskyjan at gmail.com sebechlebskyjan at gmail.com
Tue Apr 12 19:46:26 CEST 2016


Hello,
I'm sorry for delay. I made a few modifications to the patchset from the
last version apart from issues pointed by Marton:

- I discovered another source of leaks - slave muxers often allocate memory
in write_header call and free them in write_trailer. write_trailer is called
if write_header succeeded before. However in the tee when i-th slave failed to open,
write_trailer was never called on already succesfully initializated slaves.

I've changed the code in second patch so if failure happens inside open_slave function
after write_header call, write_trailer is called before open_slave function returns.
write_trailer is also called on all already initialized (alive) slaves. 

If failure happens later (in write_packet), if we are not handling slave failure
this is not a problem since master write_trailer will be called anyway.
If we are handling slave failure (third patch), the slave is closed immediately after
failure happens, so I write_trailer is called inside tee_process_slave_failure in that case.

- I removed is_alive field from TeeSlave structure, since avf field can be used instead.

I've tested several scenarios with valgrind, I believe there should be no more leaks in 
tee after this patchset is applied.

Marton, Nicolas - What do you think?

Jan S.


More information about the ffmpeg-devel mailing list