This didn't really work since the last time the channel map fallback code was touched. In some cases, quite bad results were selected.
Showing the changes to test (1 of 2 files). Show all
Unified · Split
| @@ -87,6 +87,20 @@ static void test_mp_chmap_sel_fallback_reject_unknown(void **state) { · 86 unmodified lines | ||
| 87 | 87 | assert_string_equal(mp_chmap_to_str(&b), "5.1"); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | +static void test_mp_chmap_sel_fallback_more_replacements(void **state) { | |
| 91 | + test_sel("quad", "quad(side)", LAYOUTS("quad(side)", "stereo")); | |
| 92 | + test_sel("quad", "7.0", LAYOUTS("quad(side)", "7.0")); | |
| 93 | + test_sel("quad", "7.0", LAYOUTS("7.0", "quad(side)")); | |
| 94 | + test_sel("quad", "7.1(wide-side)", LAYOUTS("7.1(wide-side)", "stereo")); | |
| 95 | + test_sel("quad", "7.1(wide-side)", LAYOUTS("stereo", "7.1(wide-side)")); | |
| 96 | + test_sel("quad", "fl-fr-fc-bl-br", | |
| 97 | + LAYOUTS("fl-fr-fc-bl-br", "fl-fr-sl-sr")); | |
| 98 | + test_sel("quad", "fl-fr-bl-br-na-na-na-na", | |
| 99 | + LAYOUTS("fl-fr-bl-br-na-na-na-na", "quad(side)", "stereo")); | |
| 100 | + test_sel("quad", "fl-fr-bl-br-na-na-na-na", | |
| 101 | + LAYOUTS("stereo", "quad(side)", "fl-fr-bl-br-na-na-na-na")); | |
| 102 | +} | |
| 103 | + | |
| 90 | 104 | int main(void) { |
| 91 | 105 | const UnitTest tests[] = { |
| 92 | 106 | unit_test(test_mp_chmap_sel_fallback_upmix), |
| @@ -101,6 +115,7 @@ int main(void) { · 8 unmodified lines | ||
| 101 | 115 | unit_test(test_mp_chmap_sel_fallback_no_downmix), |
| 102 | 116 | unit_test(test_mp_chmap_sel_fallback_minimal_downmix), |
| 103 | 117 | unit_test(test_mp_chmap_sel_fallback_reject_unknown), |
| 118 | + unit_test(test_mp_chmap_sel_fallback_more_replacements), | |
| 104 | 119 | }; |
| 105 | 120 | return run_tests(tests); |
| 106 | 121 | } |