Skip to content

Commit

Permalink
Fix argument constness for the av_codec_get_id() and
Browse files Browse the repository at this point in the history
av_codec_get_tag() functions, making them take in input a constant
array, since they're not supposed to change it. Fix some warnings.

Originally committed as revision 15795 to svn://svn.ffmpeg.org/ffmpeg/trunk
  • Loading branch information
Stefano Sabatini committed Nov 8, 2008
1 parent 502ecc9 commit 15545a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libavformat/avformat.h
Expand Up @@ -694,8 +694,8 @@ void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload);
void av_register_all(void);

/** codec tag <-> codec id */
enum CodecID av_codec_get_id(const struct AVCodecTag **tags, unsigned int tag);
unsigned int av_codec_get_tag(const struct AVCodecTag **tags, enum CodecID id);
enum CodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum CodecID id);

/* media file input */

Expand Down
4 changes: 2 additions & 2 deletions libavformat/utils.c
Expand Up @@ -1938,7 +1938,7 @@ enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag)
return CODEC_ID_NONE;
}

unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)
unsigned int av_codec_get_tag(const AVCodecTag * const *tags, enum CodecID id)
{
int i;
for(i=0; tags && tags[i]; i++){
Expand All @@ -1948,7 +1948,7 @@ unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)
return 0;
}

enum CodecID av_codec_get_id(const AVCodecTag *tags[4], unsigned int tag)
enum CodecID av_codec_get_id(const AVCodecTag * const *tags, unsigned int tag)
{
int i;
for(i=0; tags && tags[i]; i++){
Expand Down

0 comments on commit 15545a0

Please sign in to comment.