diff options
author | wm4 <wm4@nowhere> | 2015-05-08 21:22:39 +0200 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-05-09 21:14:51 +0900 |
commit | 01c452cfba04a16872e918bd6781c2c8d00a3f18 (patch) | |
tree | 2e2dbe2f25c4ee0c0e6e5a9d792e9ba6a5aea83d /test | |
parent | ba799895e14a662597a25a8ec349f889de465da5 (diff) | |
download | mpv-01c452cfba04a16872e918bd6781c2c8d00a3f18.tar.bz2 mpv-01c452cfba04a16872e918bd6781c2c8d00a3f18.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.)
(cherry picked from commit 00130651dac758f90bf98306a9d1e569ed4155ca)
Diffstat (limited to 'test')
-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) { |