[FFmpeg-cvslog] avio: Fix the deprecated fallback URL-prefixed open flags
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Fri Apr 29 19:27:56 CEST 2011
On Fri, Apr 29, 2011 at 11:11:54AM +0200, Stefano Sabatini wrote:
> On date Friday 2011-04-29 08:24:00 +0200, Reimar Döffinger wrote:
> >
> >
> > On 29 Apr 2011, at 04:38, git at videolan.org (Martin Storsjö) wrote:
> >
> > > ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Apr 28 10:36:44 2011 +0300| [5b81e295931bad4dac0af29333b4e2a203b3f4d4] | committer: Martin Storsjö
> > >
> > > avio: Fix the deprecated fallback URL-prefixed open flags
> > >
> > > While deprecated, they're totally useless as long as their values
> > > are different from the AVIO_FLAG values that are used internally.
> > > Currently, this leads to old libav applications still compiling
> > > correctly (since we haven't removed the fallback wrappers), but
> > > failing since the functions internally compare to the new AVIO_FLAG
> > > values.
> > >
> > > These should be removed at some point, but they aren't removed yet.
> > > The intent is to be able to recompile an old application against
> > > the new ABI without modifying the code, and this doesn't work
> > > currently.
> > >
> > > Signed-off-by: Martin Storsjö <martin at martin.st>
> > >
> > >> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b81e295931bad4dac0af29333b4e2a203b3f4d4
> > > ---
> > >
> > > libavformat/avio.h | 6 +++---
> > > 1 files changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/libavformat/avio.h b/libavformat/avio.h
> > > index a4ab5ae..b98137b 100644
> > > --- a/libavformat/avio.h
> > > +++ b/libavformat/avio.h
> > > @@ -150,9 +150,9 @@ attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout);
> > > * constants, optionally ORed with other flags.
> > > * @{
> > > */
> > > -#define URL_RDONLY 0 /**< read-only */
> > > -#define URL_WRONLY 1 /**< write-only */
> > > -#define URL_RDWR 2 /**< read-write */
> > > +#define URL_RDONLY 1 /**< read-only */
> > > +#define URL_WRONLY 2 /**< write-only */
> > > +#define URL_RDWR (URL_RDONLY|URL_WRONLY) /**< read-write */
> >
> > That conflicts with your change to url_fopen and I don't see the point of keeping a duplicate old API if we're breaking ABI anyway.
>
> > Could we please keep your fix for the oldabi and just get rid of it for master?
>
> IIRC the URL_* -> AVIO_FLAG_* change was done *after* the bump, so
> oldabi doesn't need the fix, and when posting the change I was
> supposing that the old interface was going to be dropped.
>
> Since the ABI was broken with the bump keeping ABI compatibility is
> not required (but not breaking API is preferred).
Even if I'd really agree (keep in mind that keeping it now means
keeping it until the next major bump, despite the risk of namespace
collissions) there's still the point that they are defined to constants
instead of the AVIO_FLAG things so happily keeping the possibility of
making the same mistake a second time.
More information about the ffmpeg-cvslog
mailing list