[FFmpeg-devel] [PATCH 1/1] avformat/tcp: support timeout for getaddrinfo For fixing stucking when resolving addrinfo

Michael Niedermayer michael at niedermayer.cc
Mon Jun 6 23:42:55 CEST 2016


On Wed, Jun 01, 2016 at 12:03:32PM +0800, XinZheng Zhang wrote:
> On Tue, May 31, 2016 at 9:33 PM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> >
> > On Tue, May 31, 2016 at 2:58 PM, Xinzheng Zhang <zhangxzheng at gmail.com> wrote:
> > > ---
> > >  libavformat/tcp.c | 215 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 215 insertions(+)
> > >
> >
> > This whole patch looks extremely complicated and long for something
> > hidden behind a tiny option not saying much.
> > Maybe you should start by elaborating in detail what you are trying to
> > fix, how you are fixing it, and why you choose this approach and not
> > any others that may appear simpler.
> >
> 
> For some ugly network conditions(Eg.Mobile device in a WiFi network,
> but offline from internet), getaddrinfo() could block tcp_open() for a
> long time,
> neither timeout nor interrupt callback can save us.
> 
> There are serveral way to fix this issue
> AFAIK. We can use `getaddrinfo_a` on some linux platform
> http://man7.org/linux/man-pages/man3/getaddrinfo_a.3.html
> But, it doesn't work on other platforms.

would the getaddrinfo_a() based code be simple ?
if so i think thats the way to go

If one really wants one could implement getaddrinfo_a() emulation
with a thread on other platforms. That should still be cleaner then
stuffing this code into tcp.c

above is just a suggestion

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160606/5e43e739/attachment.sig>


More information about the ffmpeg-devel mailing list