[FFmpeg-devel] [PATCH] avformat/unix: properly handling timeout at reading

Bodecs Bela bodecsb at vivanet.hu
Tue Mar 20 21:56:28 EET 2018

2018.03.20. 20:50 keltezéssel, Nicolas George írta:
> Bodecs Bela (2018-03-20):
>> avio rw_timeout handling in retry_transfer_wrapper() is based on returning
>> EAGAIN from protocols' read function. unix_read function returns 0 in
>> case of no data was read. It happens even if timeout it set for a valid
>> value and thus rw_timeout handling can not work and wait for ever. This
>> patch fixes the return value to AVERROR(EAGAIN) when recv()
>> reads/returns zero value/data and timeout is set.
> I am pretty sure this is not correct. Can you tell how you did observe
> that?
> Regards,
see the retry_transfer_wrapper() in avio.c If

ret = transfer_func(h, buf + len, size - len);

is always zero, so it gets into infinite loop.

transfer_func is unix_read in case of unix protocol.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

More information about the ffmpeg-devel mailing list