[FFmpeg-devel] [HACK] Remove MAX_STREAMS usages

Aurelien Jacobs aurel
Tue Aug 10 18:35:15 CEST 2010


On Tue, Aug 10, 2010 at 02:00:25PM +0200, Michael Niedermayer wrote:
> On Tue, Aug 10, 2010 at 12:42:53AM +0200, Aurelien Jacobs wrote:
> > On Sun, Aug 08, 2010 at 10:40:40PM +0200, Reimar D?ffinger wrote:
> > > [...]
> > > I want to strongly request (de-)muxer maintainers
> > > to fix their code, they should be independent of
> > > any API change, and we do not want to have to discuss
> > > with so many maintainers when we finally need to bump
> > > major.
> > 
> > Here are improved patches for nutdec and mpegts.
> > Those patches keep compatibility with current API until next major bump.
> > The nutdec patch also retain a sanity check for new API. This check can
> > be tweeked later if needed.
> > Baptiste ? Michael ?
> > 
> > Aurel
> >  nutdec.c |    8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > d0910b14a8c03d974584fece4266c8bc5d0dcd1f  max_stream_nut.diff
> > commit 97a41fd3fcb9801c18db3c35c4239e306aaae585
> > Author: Aurelien Jacobs <aurel at gnuage.org>
> > Date:   Mon Aug 9 23:11:40 2010 +0200
> > 
> >     get ride of MAX_STREAMS limit in nutdec
> > 
> > diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
> > index 1b616de..5b4a923 100644
> > --- a/libavformat/nutdec.c
> > +++ b/libavformat/nutdec.c
> > @@ -29,6 +29,12 @@
> >  #undef NDEBUG
> >  #include <assert.h>
> >  
> > +#if LIBAVFORMAT_VERSION_MAJOR < 53
> > +#define NUT_MAX_STREAMS MAX_STREAMS
> > +#else
> > +#define NUT_MAX_STREAMS 256    /* arbitrary sanity check value */
> > +#endif
> > +
> >  static int get_str(ByteIOContext *bc, char *string, unsigned int maxlen){
> >      unsigned int len= ff_get_v(bc);
> >  
> > @@ -193,7 +199,7 @@ static int decode_main_header(NUTContext *nut){
> >      end += url_ftell(bc);
> >  
> >      GET_V(tmp              , tmp >=2 && tmp <= 3)
> > -    GET_V(stream_count     , tmp > 0 && tmp <=MAX_STREAMS)
> > +    GET_V(stream_count     , tmp > 0 && tmp <= NUT_MAX_STREAMS)
> >  
> >      nut->max_distance = ff_get_v(bc);
> >      if(nut->max_distance > 65536){
> 
> ok

Applied.

Aurel



More information about the ffmpeg-devel mailing list