[FFmpeg-devel] [PATCH] Fix warning in libavformat/utils.c

Måns Rullgård mans
Sun Jun 27 20:23:48 CEST 2010


Eli Friedman <eli.friedman at gmail.com> writes:

> Patch attached; st->cur_pkt.destruct and st->cur_pkt.data have
> completely different types, so the assignment warns.
>
> -Eli
>
> Index: libavformat/utils.c
> ===================================================================
> --- libavformat/utils.c	(revision 23826)
> +++ libavformat/utils.c	(working copy)
> @@ -1077,7 +1077,7 @@
>                      if(pkt->data == st->cur_pkt.data && pkt->size == st->cur_pkt.size){
>                          s->cur_st = NULL;
>                          pkt->destruct= st->cur_pkt.destruct;
> -                        st->cur_pkt.destruct=
> +                        st->cur_pkt.destruct= NULL;
>                          st->cur_pkt.data    = NULL;
>                          assert(st->cur_len == 0);
>                      }else{

I'm OK with this.  Any remotely sane compiler will generate the same
code anyhow, and it's arguably easier to read this way.

In future, please mention which the function your patches affect
rather than the file.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list