spa: ffmpeg: remove hard-coded values

Use `sizeof` to query the size of the array instead of
hard coding it.
This commit is contained in:
Barnabás Pőcze 2021-05-15 14:18:57 +02:00 committed by Wim Taymans
parent dca37d4e08
commit 5a14e3970a

View file

@ -106,10 +106,10 @@ int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t
return 0;
if (av_codec_is_encoder(c)) {
snprintf(name, 128, "encoder.%s", c->name);
snprintf(name, sizeof(name), "encoder.%s", c->name);
f.init = ffmpeg_enc_init;
} else {
snprintf(name, 128, "decoder.%s", c->name);
snprintf(name, sizeof(name), "decoder.%s", c->name);
f.init = ffmpeg_dec_init;
}
f.name = name;