# HG changeset patch # User reimar # Date 1219597755 0 # Node ID 11169564fbdc11d2cd0d88d79486343975ff8bda # Parent f062deeedb8da2eca811958be95fc92cfd201e7b Make ogg_codec_t descriptions const diff -r f062deeedb8d -r 11169564fbdc oggdec.c --- a/oggdec.c Sun Aug 24 16:51:50 2008 +0000 +++ b/oggdec.c Sun Aug 24 17:09:15 2008 +0000 @@ -37,7 +37,7 @@ #define MAX_PAGE_SIZE 65307 #define DECODER_BUFFER_SIZE MAX_PAGE_SIZE -static ogg_codec_t *ogg_codecs[] = { +static const ogg_codec_t * const ogg_codecs[] = { &speex_codec, &vorbis_codec, &theora_codec, @@ -126,7 +126,7 @@ return 0; } -static ogg_codec_t * +static const ogg_codec_t * ogg_find_codec (uint8_t * buf, int size) { int i; diff -r f062deeedb8d -r 11169564fbdc oggdec.h --- a/oggdec.h Sun Aug 24 16:51:50 2008 +0000 +++ b/oggdec.h Sun Aug 24 17:09:15 2008 +0000 @@ -75,15 +75,15 @@ #define OGG_FLAG_BOS 2 #define OGG_FLAG_EOS 4 -extern ogg_codec_t flac_codec; -extern ogg_codec_t ogm_audio_codec; -extern ogg_codec_t ogm_old_codec; -extern ogg_codec_t ogm_text_codec; -extern ogg_codec_t ogm_video_codec; -extern ogg_codec_t old_flac_codec; -extern ogg_codec_t speex_codec; -extern ogg_codec_t theora_codec; -extern ogg_codec_t vorbis_codec; +extern const ogg_codec_t flac_codec; +extern const ogg_codec_t ogm_audio_codec; +extern const ogg_codec_t ogm_old_codec; +extern const ogg_codec_t ogm_text_codec; +extern const ogg_codec_t ogm_video_codec; +extern const ogg_codec_t old_flac_codec; +extern const ogg_codec_t speex_codec; +extern const ogg_codec_t theora_codec; +extern const ogg_codec_t vorbis_codec; extern int vorbis_comment(AVFormatContext *ms, uint8_t *buf, int size); diff -r f062deeedb8d -r 11169564fbdc oggparseflac.c --- a/oggparseflac.c Sun Aug 24 16:51:50 2008 +0000 +++ b/oggparseflac.c Sun Aug 24 17:09:15 2008 +0000 @@ -85,13 +85,13 @@ return 0; } -ogg_codec_t flac_codec = { +const ogg_codec_t flac_codec = { .magic = "\177FLAC", .magicsize = 5, .header = flac_header }; -ogg_codec_t old_flac_codec = { +const ogg_codec_t old_flac_codec = { .magic = "fLaC", .magicsize = 4, .header = old_flac_header diff -r f062deeedb8d -r 11169564fbdc oggparseogm.c --- a/oggparseogm.c Sun Aug 24 16:51:50 2008 +0000 +++ b/oggparseogm.c Sun Aug 24 17:09:15 2008 +0000 @@ -149,28 +149,28 @@ return 0; } -ogg_codec_t ogm_video_codec = { +const ogg_codec_t ogm_video_codec = { .magic = "\001video", .magicsize = 6, .header = ogm_header, .packet = ogm_packet }; -ogg_codec_t ogm_audio_codec = { +const ogg_codec_t ogm_audio_codec = { .magic = "\001audio", .magicsize = 6, .header = ogm_header, .packet = ogm_packet }; -ogg_codec_t ogm_text_codec = { +const ogg_codec_t ogm_text_codec = { .magic = "\001text", .magicsize = 5, .header = ogm_header, .packet = ogm_packet }; -ogg_codec_t ogm_old_codec = { +const ogg_codec_t ogm_old_codec = { .magic = "\001Direct Show Samples embedded in Ogg", .magicsize = 35, .header = ogm_dshow_header, diff -r f062deeedb8d -r 11169564fbdc oggparsespeex.c --- a/oggparsespeex.c Sun Aug 24 16:51:50 2008 +0000 +++ b/oggparsespeex.c Sun Aug 24 17:09:15 2008 +0000 @@ -54,7 +54,7 @@ return 0; } -ogg_codec_t speex_codec = { +const ogg_codec_t speex_codec = { .magic = "Speex ", .magicsize = 8, .header = speex_header diff -r f062deeedb8d -r 11169564fbdc oggparsetheora.c --- a/oggparsetheora.c Sun Aug 24 16:51:50 2008 +0000 +++ b/oggparsetheora.c Sun Aug 24 17:09:15 2008 +0000 @@ -130,7 +130,7 @@ return iframe + pframe; } -ogg_codec_t theora_codec = { +const ogg_codec_t theora_codec = { .magic = "\200theora", .magicsize = 7, .header = theora_header, diff -r f062deeedb8d -r 11169564fbdc oggparsevorbis.c --- a/oggparsevorbis.c Sun Aug 24 16:51:50 2008 +0000 +++ b/oggparsevorbis.c Sun Aug 24 17:09:15 2008 +0000 @@ -219,7 +219,7 @@ return os->seq < 3; } -ogg_codec_t vorbis_codec = { +const ogg_codec_t vorbis_codec = { .magic = "\001vorbis", .magicsize = 7, .header = vorbis_header