[FFmpeg-devel] [HACK] Remove MAX_STREAMS usages

Michael Niedermayer michaelni
Tue Aug 10 14:00:25 CEST 2010


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

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

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100810/75109b75/attachment.pgp>



More information about the ffmpeg-devel mailing list