aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-25 21:50:50 +0100
committerMax Kellermann <max@duempel.org>2009-02-25 21:50:50 +0100
commitd90246537518bbb103f5bd1ebd04da0e8a626c6e (patch)
tree7043527ec3eed29316314c3563dbf9cf8c395015
parentfff52ac5b94bb05ef06bb6a499526cb5e5b31100 (diff)
downloadmpd-d90246537518bbb103f5bd1ebd04da0e8a626c6e.tar.gz
mpd-d90246537518bbb103f5bd1ebd04da0e8a626c6e.tar.xz
mpd-d90246537518bbb103f5bd1ebd04da0e8a626c6e.zip
mvp: use G_N_ELEMENTS(mvp_sample_rates)
Instead of manually calculating the number of elements in the mvp_sample_rates array, use GLib's convenience macro G_N_ELEMENTS().
-rw-r--r--src/output/mvp_plugin.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/output/mvp_plugin.c b/src/output/mvp_plugin.c
index c9876b65e..c15935597 100644
--- a/src/output/mvp_plugin.c
+++ b/src/output/mvp_plugin.c
@@ -89,9 +89,6 @@ static unsigned mvp_sample_rates[][3] = {
{15, 96000, 48000}
};
-static const unsigned numfrequencies =
- sizeof(mvp_sample_rates) / sizeof(mvp_sample_rates[0]);
-
static bool
mvp_output_test_default_device(void)
{
@@ -161,14 +158,14 @@ mvp_set_pcm_params(struct mvp_data *md, unsigned long rate, int channels,
/*
* if there is an exact match for the frequency, use it.
*/
- for (iloop = 0; iloop < numfrequencies; iloop++) {
+ for (iloop = 0; iloop < G_N_ELEMENTS(mvp_sample_rates); iloop++) {
if (rate == mvp_sample_rates[iloop][1]) {
mix[2] = mvp_sample_rates[iloop][0];
break;
}
}
- if (iloop >= numfrequencies) {
+ if (iloop >= G_N_ELEMENTS(mvp_sample_rates)) {
g_warning("Can not find suitable output frequency for %ld\n",
rate);
return -1;