[FFmpeg-devel] [PATCH] Disable puts and change it to av_log

Diego Biurrun diego
Wed Jan 16 23:28:08 CET 2008


On Wed, Jan 16, 2008 at 11:12:29PM +0100, Michael Niedermayer wrote:
> On Wed, Jan 16, 2008 at 10:40:31PM +0100, Diego Biurrun wrote:
> > On Wed, Jan 16, 2008 at 09:15:51PM +0100, Michael Niedermayer wrote:
> > > On Wed, Jan 16, 2008 at 07:55:33PM +0100, Sigbj?rn Skj?ret wrote:
> > > > puts.diffs changes puts() to av_log() and puts2.diffs makes sure any further
> > > > use of puts will fail to link.
> > > 
> > > you missed libavcodec/mace.c
> > > 
> > > either way
> > > patches ok
> > 
> > Here is a version with mace.c.
> > 
> > --- libavformat/gif.c	(revision 11540)
> > +++ libavformat/gif.c	(working copy)
> > @@ -137,7 +137,7 @@
> >          //printf("bitbuf = %08x\n", bit_buf);
> >          s->buf_ptr+=4;
> >          if (s->buf_ptr >= s->buf_end)
> > -            puts("bit buffer overflow !!"); // should never happen ! who got rid of the callback ???
> > +            av_log(NULL,AV_LOG_WARNING,"bit buffer overflow !!"); // should never happen ! who got rid of the callback ???
> >  //            flush_buffer_rev(s);
> >          bit_cnt=bit_cnt + n - 32;
> >          if (bit_cnt == 0) {
> > --- libavcodec/gif.c	(revision 11540)
> > +++ libavcodec/gif.c	(working copy)
> > @@ -136,7 +136,7 @@
> >  
> >          //printf("bitbuf = %08x\n", bit_buf);
> >          if (s->buf_ptr >= s->buf_end)
> > -            puts("bit buffer overflow !!"); // should never happen ! who got rid of the callback ???
> > +            av_log(NULL,AV_LOG_WARNING,"bit buffer overflow !!"); // should never happen ! who got rid of the callback ???
> 
> after reading this again these should be abort()s
> 
> anyway this code is a mess (all the gif_put_bit should be removed)

Sounds like this is outside of the scope of my patch then.

> > --- libavcodec/mace.c	(revision 11540)
> > +++ libavcodec/mace.c	(working copy)
> > @@ -410,7 +410,7 @@
> >      case CODEC_ID_MACE3:
> >  #ifdef DEBUG
> > -puts("mace_decode_frame[3]()");
> > +        av_log(avctx,AV_LOG_DEBUG,"mace_decode_frame[3]()");
> >  #endif
> 
> dprintf
> 
> > @@ -419,7 +419,7 @@
> >      case CODEC_ID_MACE6:
> >  #ifdef DEBUG
> > -puts("mace_decode_frame[6]()");
> > +        av_log(avctx,AV_LOG_DEBUG, "mace_decode_frame[6]()");
> >  #endif
> 
> dprintf

Changed.

Attached patch OK to commit then?

Diego
-------------- next part --------------
A non-text attachment was scrubbed...
Name: puts1.diff
Type: text/x-diff
Size: 2186 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080116/4ca2438f/attachment.diff>



More information about the ffmpeg-devel mailing list