diff options
author | wm4 <wm4@nowhere> | 2015-05-08 21:22:39 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-08 21:22:39 +0200 |
commit | 00130651dac758f90bf98306a9d1e569ed4155ca (patch) | |
tree | 43e58cd511d0db7f1f312d1befe7562a6c283ab6 /test/chmap.c | |
parent | 8d5924f2c9c7d80b45cd68b44cb9c74e7b0b5a8c (diff) | |
download | mpv-00130651dac758f90bf98306a9d1e569ed4155ca.tar.bz2 mpv-00130651dac758f90bf98306a9d1e569ed4155ca.tar.xz |
audio: simplify further
Drop mp_chmap_diff() (which is unused too now), and implement
mp_chmap_diffn() in a slightly simpler way. (Too bad there is no
standard function for counting set bits.)
Diffstat (limited to 'test/chmap.c')
-rw-r--r-- | test/chmap.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/test/chmap.c b/test/chmap.c index 4bd4ba7b58..365c15be52 100644 --- a/test/chmap.c +++ b/test/chmap.c @@ -4,24 +4,15 @@ static void test_mp_chmap_diff(void **state) { struct mp_chmap a; struct mp_chmap b; - struct mp_chmap diff; mp_chmap_from_str(&a, bstr0("3.1")); mp_chmap_from_str(&b, bstr0("2.1")); - mp_chmap_diff(&a, &b, &diff); - assert_int_equal(diff.num, 1); - assert_int_equal(diff.speaker[0], MP_SPEAKER_ID_FC); + assert_int_equal(mp_chmap_diffn(&a, &b), 1); mp_chmap_from_str(&b, bstr0("6.1(back)")); - mp_chmap_diff(&a, &b, &diff); - assert_int_equal(diff.num, 0); - - mp_chmap_diff(&b, &a, &diff); - assert_int_equal(diff.num, 3); - assert_int_equal(diff.speaker[0], MP_SPEAKER_ID_BL); - assert_int_equal(diff.speaker[1], MP_SPEAKER_ID_BR); - assert_int_equal(diff.speaker[2], MP_SPEAKER_ID_BC); + assert_int_equal(mp_chmap_diffn(&a, &b), 0); + assert_int_equal(mp_chmap_diffn(&b, &a), 3); } int main(void) { |