]> git.sesse.net Git - ffmpeg/commit
http: block while waiting for reconnecting
authorwm4 <nfxjfg@googlemail.com>
Tue, 2 Jan 2018 16:05:03 +0000 (17:05 +0100)
committerwm4 <nfxjfg@googlemail.com>
Thu, 4 Jan 2018 14:07:55 +0000 (15:07 +0100)
commit8a108bdea06fac43af9f44b6d2538f357451167a
tree24428bb98451621940eb507a2b10173fe741a202
parent89bbf5c7ec18a3dff2e2505883a662d182ca6c3a
http: block while waiting for reconnecting

It makes no sense to return an error after the first reconnect, and then
somehow resume the next time it's called. Usually this will lead to
demuxer errors. Make reconnecting block instead, until it has either
successfully reconnected, or given up.

Also make the wait reasonably interruptible. Since there is no mechanism
for this in the API, polling is the best we can do. This behaves roughly
the same as other interruptible network functions in libavformat.

(The original code would work if it returned AVERROR(EAGAIN) or so,
which would make retry_transfer_wrapper() repeat the read call. But I
think having an explicit loop for this is better anyway.)

I also snuck in a fix for reconnect_at_eof. It has to check for
AVERROR_EOF, not 0.
libavformat/http.c
libavformat/network.c
libavformat/network.h