[FFmpeg-devel] [PATCH] Fix flush_pkt warning in ffplay.c

Michael Niedermayer michaelni
Thu Dec 4 11:55:38 CET 2008


On Thu, Dec 04, 2008 at 09:12:08AM +0100, Stefano Sabatini wrote:
> On date Wednesday 2008-12-03 16:25:00 -0800, Baptiste Coudurier encoded:
> > Hi,
> > 
> > Stefano Sabatini wrote:
> > > Hi,
> > > 
> > > this fixes the warning:
> > > ffplay.c: In function ?main?:
> > > ffplay.c:2875: warning: assignment discards qualifiers from pointer target type
> > > 
> > > Regards.
> > > 
> > > 
> > > ------------------------------------------------------------------------
> > > 
> > > Index: ffplay.c
> > > ===================================================================
> > > --- ffplay.c	(revision 15995)
> > > +++ ffplay.c	(working copy)
> > > @@ -2583,7 +2583,7 @@
> > >      SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
> > >  
> > >      av_init_packet(&flush_pkt);
> > > -    flush_pkt.data= "FLUSH";
> > > +    flush_pkt.data= av_strdup("FLUSH");
> > 
> > Set destruct_packet then to free 'data'.
> 
> Yes, regards.

patch rejected, flush_pkt.data MUST NOT be freed this would
break the code. The packet is used many times (and could be "freed") it is
allocated only once in main()
the original code is correct, a solution to the warning should not change
ffplay.o, especially it should not add extra code into the object file as
there is no need for that.

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081204/4300933e/attachment.pgp>



More information about the ffmpeg-devel mailing list