[FFmpeg-devel] Tee improvement - discussion

Nicolas George george at nsup.org
Fri Jun 3 15:53:53 CEST 2016


Le nonidi 9 prairial, an CCXXIV, Jan Sebechlebsky a écrit :
> If I understand it correctly, I think this will be handled quite smoothy -
> you don't have to kill the blocked write, the application has to call
> write_trailer anyway before closing the muxer, so I guess this is the place
> where tee will wait for the muxer's pending write operation to finish. So
> application will know, that after call to write_trailer all operations are
> finished.

There is no "after call to write_trailer": the real muxer is blocked
writing, it will not terminate. By pushing it in a thread, you may have
achieved non-blocking writes for the application, but that just pushed the
issue a bit further.

To achieve real non-blocking operation, you need to have all the muxers and
protocols stack working in non-blocking mode, or you need asynchronous
killing of I/O operations. Asynchronous killing of I/O operations exists,
that is pthread_cancel(), but it is quite tricky to use and we had no end of
portability issues with it too.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160603/c97fe5f1/attachment.sig>


More information about the ffmpeg-devel mailing list