[FFmpeg-devel] [PATCH] Add a new flag AVFMT_NETWORK

Martin Storsjö martin
Mon Oct 11 16:19:09 CEST 2010


On Mon, 11 Oct 2010, Michael Niedermayer wrote:

> On Mon, Oct 11, 2010 at 04:26:59PM +0300, Martin Storsj? wrote:
> > Hi,
> > 
> > By adding a flag AVFMT_NETWORK, we could move calling 
> > ff_network_init()/ff_network_close to common code in utils.c, instead of 
> > having to have this in the muxers/demuxers that use network functions 
> > before opening protocols.
> > 
> > This allows us to remove the extra ff_network_init/ff_network_close calls 
> > from the rtsp/sdp/sap demuxers/muxers open/close functions, as in the 
> > second patch.
> > 
> > Opinions?
> 
> 30 lines added, 19 removed
> 
> so it seems its more complex after this patch, what do we gain with it?

Yes, slightly. But if more muxers/demuxers that use network functions 
directly are added, they would all need the same initialization code (call 
ff_network_init() at the start, if returning an error, call 
ff_network_close(), oterwise call ff_network_close() in the close 
function).

If you don't think this is worth the extra flag, I'm ok with keeping this 
code within the (de)muxers also.

// Martin



More information about the ffmpeg-devel mailing list