Commit e7c2da6c authored by Rafaël Carré's avatar Rafaël Carré

Avoid a few relocations

parent f6fce728
......@@ -625,13 +625,12 @@ bool aout_CheckChannelExtraction( int *pi_selection,
static int FilterOrder( const char *psz_name )
{
static const struct {
const char *psz_name;
const char psz_name[10];
int i_order;
} filter[] = {
{ "equalizer", 0 },
{ NULL, INT_MAX },
};
for( int i = 0; filter[i].psz_name; i++ )
for( unsigned i = 0; i < ARRAY_SIZE(filter); i++ )
{
if( !strcmp( filter[i].psz_name, psz_name ) )
return filter[i].i_order;
......@@ -742,6 +741,3 @@ bool aout_ChangeFilterString( vlc_object_t *p_obj, vlc_object_t *p_aout,
return true;
}
......@@ -531,7 +531,7 @@ static picture_t *ImageFilter( image_handler_t *p_image, picture_t *p_pic,
static const struct
{
vlc_fourcc_t i_codec;
const char *psz_ext;
const char psz_ext[7];
} ext_table[] =
{
......@@ -554,14 +554,11 @@ static const struct
{ VLC_CODEC_TIFF, "tiff" },
{ VLC_FOURCC('l','b','m',' '), "lbm" },
{ VLC_CODEC_PPM, "ppm" },
{ 0, NULL }
};
vlc_fourcc_t image_Type2Fourcc( const char *psz_type )
{
int i;
for( i = 0; ext_table[i].i_codec; i++ )
for( unsigned i = 0; i < ARRAY_SIZE(ext_table); i++ )
if( !strcasecmp( ext_table[i].psz_ext, psz_type ) )
return ext_table[i].i_codec;
......@@ -580,12 +577,9 @@ vlc_fourcc_t image_Ext2Fourcc( const char *psz_name )
/*
static const char *Fourcc2Ext( vlc_fourcc_t i_codec )
{
int i;
for( i = 0; ext_table[i].i_codec != 0; i++ )
{
if( ext_table[i].i_codec == i_codec ) return ext_table[i].psz_ext;
}
for( unsigned i = 0; i < ARRAY_SIZE(ext_table); i++ )
if( ext_table[i].i_codec == i_codec )
return ext_table[i].psz_ext;
return NULL;
}
......
......@@ -38,7 +38,7 @@
* You can use the non vout filter if and only if the video properties stay the
* same (width/height/chroma/fps), at least for now.
*/
static const char *deinterlace_modes[] = {
static const char deinterlace_modes[][9]= {
""
"discard",
"blend",
......@@ -50,11 +50,11 @@ static const char *deinterlace_modes[] = {
"yadif2x",
"phosphor",
"ivtc",
NULL
};
static bool DeinterlaceIsModeValid(const char *mode)
{
for (unsigned i = 0; deinterlace_modes[i]; i++) {
for (unsigned i = 0; i < ARRAY_SIZE(deinterlace_modes); i++) {
if (!strcmp(deinterlace_modes[i], mode))
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment