[FFmpeg-devel] const abuse in rtp.c

Måns Rullgård mans
Sun Jul 8 02:23:16 CEST 2007


rtp.c, line 691 looks like this:

            s->buf_ptr = buf;

Here, buf is const uint8_t * argument to the function rtp_parse_packet(),
and s->buf_ptr is a plain uint8_t *.  Hence gcc gives us a friendly
warning:

/home/mru/src/ffmpeg/libavformat/rtp.c:691: warning: assignment discards qualifiers from pointer target type

In other parts of the file data is written through this same
s->buf_ptr pointer.  Not having examined the code closely (and to be
honest, it quite frightens me), I'm ready to believe that these uses
of s->buf_ptr are mutually exclusive.

Can someone who knows this code please confirm whether this is the
case?  If it is, would it be feasible to separate these uses somehow
so the const violations could be avoided.  If not, we've got even more
trouble...

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




More information about the ffmpeg-devel mailing list