[MPlayer-users] Using network protocols without global network initialization. Please use avformat_network_init()

wm4 nfxjfg at googlemail.com
Thu Jun 4 21:29:11 CEST 2015


On Thu, 4 Jun 2015 20:38:06 +0200
Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:

> On Wed, Jun 03, 2015 at 07:28:10PM +0200, wm4 wrote:
> > On Wed, 3 Jun 2015 19:09:52 +0200
> > Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:
> > 
> > > On Mon, Jun 01, 2015 at 06:34:04PM +1000, andrew wrote:
> > > > On Sun, May 31, 2015 at 11:00:46PM +0200, Rasz wrote:
> > > > 
> > > > > I know it comes from libavformat/network.c, but what does that mean?
> > > > 
> > > > I am also keen to know as this often spams my terminal :)
> > > 
> > > FFmpeg's libavformat wants you to call a special function when you want to
> > > use any networking protocols.
> > > However it is not generally possible to know if your use of libavformat
> > > will end up using networking protocols or not.
> > > So what libavformat "wants" isn't really possible to do in a sensible
> > > way and thus I have so far just ignored these printouts.
> > > However I guess we would make it happy in the cases where
> > > it is easy (like https:// URLs) and thus reduce the number
> > > of cases where this spam appears.
> > 
> > That's a funny thing to consider libavformat and libavcodec generally
> > need global init calls (the register functions).
> 
> I have not analyzed the cost of the network init code.
> I assumed there is some significant cost, otherwise
> those other init calls could just do the network init
> and this separate function is useless and the printout
> spam pointless.

No, no. This is because GnuTLS and OpenSSL were written by idiots. They
require global init for no good reason, and to make it even "nicer",
they:

1. have uninit calls too
2. uninit calls in other software or libraries might undo your own init
3. the calls aren't even thread-safe

So libavformat can't do anything about this. Other than implementing
its own TLS code, or running the TLS lib in a separate process, or
fixing the API upstream.

> Either way around, I can't figure out any explanation
> that ends with anything other than this API and message
> being idiotic.

Personally I think it should just abort() instead of printing the
message. I take it that using OpenSSL and GnuTLS without the global
init calls is not valid.



More information about the MPlayer-users mailing list