[FFmpeg-devel] [RFC] libavformat/avio.h API cleanup

Michael Niedermayer michaelni
Sun Mar 6 19:46:18 CET 2011


On Sun, Mar 06, 2011 at 05:31:55PM +0000, M?ns Rullg?rd wrote:
> Nicolas George <nicolas.george at normalesup.org> writes:
> 
> > Le sextidi 16 vent?se, an CCXIX, Stefano Sabatini a ?crit?:
> >> > URL_RDONLY
> >> > URL_WRONLY
> >> > URL_RDWR
> >> > URL_FLAG_NONBLOCK
> >> Maybe we should add FLAG to the other constants.
> >
> > RDONLY / WRONLY / RDWR are not really flags: flags are usually supposed to
> > be booleans, they are there or not.
> >
> > I think this is an historical misfeature of Unix to have these three modes
> > and not FLAG_READ and FLAG_WRITE, with READ_WRITE = FLAG_READ | FLAG_WRITE.
> > ffmpeg just imitated it.
> >
> >>> url_exist
> >> This function is problematic:
> >> http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/102825
> >
> > Summary: the function opens to check for existence, this can be wrong (if
> > the permissions are insufficient) or problematic (on FIFOs) in some
> > situations.
> >
> > Having a mode of open that requests neither read nor write would be a
> > solution to say that we want to just check for existence.
> 
> Existence checks are almost always wrong as by the time you act on the
> information, it may already be stale, leaving the door open for race
> conditions which may have serious security implications.

Please send a patch that adds that to the doxy of the function.

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

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110306/7de902dd/attachment.pgp>



More information about the ffmpeg-devel mailing list