From c292a8d56fc0531297775cf64f14190b26b9b216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sun, 23 Dec 2007 17:18:36 +0100 Subject: Mark all supported_types constant. --- src/combined/ffmpeg/ff_audio_decoder.c | 2 +- src/combined/ffmpeg/ff_video_decoder.c | 6 +++--- src/combined/flac_decoder.c | 2 +- src/combined/nsf_combined.c | 2 +- src/combined/wavpack_combined.c | 2 +- src/combined/xine_speex_decoder.c | 2 +- src/combined/xine_theora_decoder.c | 2 +- src/combined/xine_vorbis_decoder.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/combined') diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c index dd03cd2a3..f79014fde 100644 --- a/src/combined/ffmpeg/ff_audio_decoder.c +++ b/src/combined/ffmpeg/ff_audio_decoder.c @@ -431,7 +431,7 @@ void *init_audio_plugin (xine_t *xine, void *data) { return this; } -static uint32_t supported_audio_types[] = { +static const uint32_t supported_audio_types[] = { #if defined(HAVE_FFMPEG) || CONFIG_WMAV1_DECODER BUF_AUDIO_WMAV1, #endif diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 4e5e1ebdf..d12d54c5b 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -1565,7 +1565,7 @@ void *init_video_plugin (xine_t *xine, void *data) { return this; } -static uint32_t supported_video_types[] = { +static const uint32_t supported_video_types[] = { #if defined(HAVE_FFMPEG) || CONFIG_MSMPEG4V1_DECODER BUF_VIDEO_MSMPEG4_V1, #endif @@ -1790,12 +1790,12 @@ static uint32_t supported_video_types[] = { 0 }; -static uint32_t wmv8_video_types[] = { +static const uint32_t wmv8_video_types[] = { BUF_VIDEO_WMV8, 0 }; -static uint32_t wmv9_video_types[] = { +static const uint32_t wmv9_video_types[] = { BUF_VIDEO_WMV9, 0 }; diff --git a/src/combined/flac_decoder.c b/src/combined/flac_decoder.c index 40c5fa6a3..43bad327e 100644 --- a/src/combined/flac_decoder.c +++ b/src/combined/flac_decoder.c @@ -396,7 +396,7 @@ init_plugin (xine_t *xine, void *data) { void *demux_flac_init_class (xine_t *xine, void *data); -static uint32_t audio_types[] = { +static const uint32_t audio_types[] = { BUF_AUDIO_FLAC, 0 }; diff --git a/src/combined/nsf_combined.c b/src/combined/nsf_combined.c index 18ab05863..0364e2db2 100644 --- a/src/combined/nsf_combined.c +++ b/src/combined/nsf_combined.c @@ -25,7 +25,7 @@ static const demuxer_info_t demux_info_nsf = { 10 /* priority */ }; -static uint32_t audio_types[] = { +static const uint32_t audio_types[] = { BUF_AUDIO_NSF, 0 }; diff --git a/src/combined/wavpack_combined.c b/src/combined/wavpack_combined.c index edf4bec01..8a4b488ae 100644 --- a/src/combined/wavpack_combined.c +++ b/src/combined/wavpack_combined.c @@ -27,7 +27,7 @@ static const demuxer_info_t demux_info_wv = { 0 /* priority */ }; -static uint32_t audio_types[] = { +static const uint32_t audio_types[] = { BUF_AUDIO_WAVPACK, 0 }; diff --git a/src/combined/xine_speex_decoder.c b/src/combined/xine_speex_decoder.c index a94ab0c0e..d189ecc58 100644 --- a/src/combined/xine_speex_decoder.c +++ b/src/combined/xine_speex_decoder.c @@ -390,7 +390,7 @@ void *speex_init_plugin (xine_t *xine, void *data) { return this; } -static uint32_t audio_types[] = { +static const uint32_t audio_types[] = { BUF_AUDIO_SPEEX, 0 }; diff --git a/src/combined/xine_theora_decoder.c b/src/combined/xine_theora_decoder.c index 262cb5414..96d4ca8f0 100644 --- a/src/combined/xine_theora_decoder.c +++ b/src/combined/xine_theora_decoder.c @@ -361,7 +361,7 @@ void *theora_init_plugin (xine_t *xine, void *data) { * exported plugin catalog entry */ -static uint32_t supported_types[] = { BUF_VIDEO_THEORA, 0 }; +static const uint32_t supported_types[] = { BUF_VIDEO_THEORA, 0 }; const decoder_info_t dec_info_theora = { supported_types, /* supported types */ diff --git a/src/combined/xine_vorbis_decoder.c b/src/combined/xine_vorbis_decoder.c index 143c761c4..6d651f153 100644 --- a/src/combined/xine_vorbis_decoder.c +++ b/src/combined/xine_vorbis_decoder.c @@ -324,7 +324,7 @@ void *vorbis_init_plugin (xine_t *xine, void *data) { return this; } -static uint32_t audio_types[] = { +static const uint32_t audio_types[] = { BUF_AUDIO_VORBIS, 0 }; -- cgit v1.2.3 From dc15ad64ff2d9de8dc4c53a3f42fbeea771971f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sun, 23 Dec 2007 18:44:38 +0100 Subject: Fix for os_types.h move. --- src/combined/wavpack_combined.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/combined') diff --git a/src/combined/wavpack_combined.h b/src/combined/wavpack_combined.h index 264609bf2..42b0bfd51 100644 --- a/src/combined/wavpack_combined.h +++ b/src/combined/wavpack_combined.h @@ -20,7 +20,7 @@ * xine interface to libwavpack by Diego Pettenò */ -#include "os_types.h" +#include #include "bswap.h" typedef struct { -- cgit v1.2.3 From dc82a4b85e2fd3164ed7c3a12514d46be579d99d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 28 Dec 2007 13:54:11 +0100 Subject: Fix another included header. --- src/combined/flac_demuxer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/combined') diff --git a/src/combined/flac_demuxer.c b/src/combined/flac_demuxer.c index 1f390a86f..bab42876c 100644 --- a/src/combined/flac_demuxer.c +++ b/src/combined/flac_demuxer.c @@ -53,7 +53,7 @@ #include #include -#include "../demuxers/demux.h" +#include #ifndef LEGACY_FLAC # define FLAC__SeekableStreamDecoder FLAC__StreamDecoder -- cgit v1.2.3 From 150d8389b4a38b6041b284911742347e74dcea40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 2 Jan 2008 18:39:23 +0100 Subject: Make speex_comment_keys constant, and use character arrays rather than literals' pointers. This increase a bit the machine code for the function, but seems to decrease the size of the plugin in general. It also will avoid a lot of relocations, and move speex_comment_keys entirely in .rodata. --- src/combined/xine_speex_decoder.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/combined') diff --git a/src/combined/xine_speex_decoder.c b/src/combined/xine_speex_decoder.c index d189ecc58..865232e30 100644 --- a/src/combined/xine_speex_decoder.c +++ b/src/combined/xine_speex_decoder.c @@ -92,8 +92,8 @@ static void speex_discontinuity (audio_decoder_t *this_gen) { } /* Known speex comment keys from ogg123 sources*/ -static struct { - char *key; /* includes the '=' for programming convenience */ +static const struct { + char key[16]; /* includes the '=' for programming convenience */ int xine_metainfo_index; } speex_comment_keys[] = { {"ARTIST=", XINE_META_INFO_ARTIST}, @@ -101,8 +101,7 @@ static struct { {"TITLE=", XINE_META_INFO_TITLE}, {"GENRE=", XINE_META_INFO_GENRE}, {"DESCRIPTION=", XINE_META_INFO_COMMENT}, - {"DATE=", XINE_META_INFO_YEAR}, - {NULL, 0} + {"DATE=", XINE_META_INFO_YEAR} }; #define readint(buf, base) (((buf[base+3]<<24)&0xff000000)| \ @@ -169,8 +168,7 @@ void read_metadata (speex_decoder_t *this, char * comments, int length) printf ("\n"); #endif - for (i = 0; speex_comment_keys[i].key != NULL; i++) { - + for (i = 0; i < (sizeof(speex_comment_keys)/sizeof(speex_comment_keys[0])); i++) { if ( !strncasecmp (speex_comment_keys[i].key, c, strlen(speex_comment_keys[i].key)) ) { int keylen = strlen(speex_comment_keys[i].key); -- cgit v1.2.3