@@ -380,12 +380,12 @@ test_resampler_duplex(uint32_t input_channels, uint32_t output_channels,
380380 dump (" input.raw" , state.input .data (), state.input .length ());
381381 dump (" output.raw" , state.output .data (), state.output .length ());
382382
383- ASSERT_TRUE (array_fuzzy_equal (state. input , expected_resampled_input,
384- epsilon<T>( static_cast < float >(input_rate) /
385- target_rate)));
386- ASSERT_TRUE (array_fuzzy_equal (state. output , expected_resampled_output,
387- epsilon<T>( static_cast < float >(output_rate) /
388- target_rate)));
383+ ASSERT_TRUE (array_fuzzy_equal (
384+ state. input , expected_resampled_input,
385+ epsilon<T>( static_cast < float >(input_rate) / target_rate)));
386+ ASSERT_TRUE (array_fuzzy_equal (
387+ state. output , expected_resampled_output,
388+ epsilon<T>( static_cast < float >(output_rate) / target_rate)));
389389
390390 cubeb_resampler_destroy (resampler);
391391}
@@ -762,7 +762,8 @@ TEST(cubeb, resampler_passthrough_duplex_callback_reordering)
762762
763763 output_seq_idx += BUF_BASE_SIZE ;
764764
765- // prebuffer_frames holds all provided frames, even if some are in the internal buffer.
765+ // prebuffer_frames holds all provided frames, even if some are in the
766+ // internal buffer.
766767 ASSERT_EQ (prebuffer_frames, BUF_BASE_SIZE * 2 );
767768 ASSERT_EQ (got, BUF_BASE_SIZE );
768769
@@ -863,7 +864,8 @@ TEST(cubeb, resampler_drift_drop_data)
863864
864865 output_seq_idx += BUF_BASE_SIZE ;
865866
866- // prebuffer_frames holds all provided frames, even if some are in the internal buffer.
867+ // prebuffer_frames holds all provided frames, even if some are in the
868+ // internal buffer.
867869 ASSERT_EQ (prebuffer_frames, BUF_BASE_SIZE * PREBUFFER_FACTOR );
868870 ASSERT_EQ (got, BUF_BASE_SIZE );
869871
@@ -1098,8 +1100,7 @@ struct input_queue_state {
10981100};
10991101
11001102static long
1101- input_queue_cb (cubeb_stream *, void * ptr, const void * in, void * out,
1102- long n)
1103+ input_queue_cb (cubeb_stream *, void * ptr, const void * in, void * out, long n)
11031104{
11041105 if (in) {
11051106 static_cast <input_queue_state *>(ptr)->frames_seen += n;
@@ -1120,10 +1121,9 @@ TEST(cubeb, resampler_speex_input_queue)
11201121 in_p.prefs = out_p.prefs = CUBEB_STREAM_PREF_NONE ;
11211122
11221123 input_queue_state state;
1123- cubeb_resampler * r =
1124- cubeb_resampler_create (nullptr , &in_p, &out_p, 44100 , input_queue_cb,
1125- &state, CUBEB_RESAMPLER_QUALITY_VOIP ,
1126- CUBEB_RESAMPLER_RECLOCK_NONE );
1124+ cubeb_resampler * r = cubeb_resampler_create (
1125+ nullptr , &in_p, &out_p, 44100 , input_queue_cb, &state,
1126+ CUBEB_RESAMPLER_QUALITY_VOIP , CUBEB_RESAMPLER_RECLOCK_NONE );
11271127 ASSERT_NE (r, nullptr );
11281128
11291129 const long out_chunk = 480 ;
@@ -1139,8 +1139,8 @@ TEST(cubeb, resampler_speex_input_queue)
11391139 }
11401140 state.frames_provided += frames_to_provide;
11411141 long in_count = frames_to_provide;
1142- long got =
1143- cubeb_resampler_fill (r, in_buf. data (), &in_count, out_buf. data (), out_chunk);
1142+ long got = cubeb_resampler_fill (r, in_buf. data (), &in_count, out_buf. data (),
1143+ out_chunk);
11441144 ASSERT_EQ (got, out_chunk);
11451145 ASSERT_EQ (in_count, frames_to_provide);
11461146
@@ -1150,8 +1150,7 @@ TEST(cubeb, resampler_speex_input_queue)
11501150
11511151 EXPECT_LE (state.frames_seen , state.frames_provided );
11521152 EXPECT_GE (state.frames_seen ,
1153- state.frames_provided -
1154- (long )min_buffered_audio_frame (in_p.rate ));
1153+ state.frames_provided - (long )min_buffered_audio_frame (in_p.rate ));
11551154
11561155 cubeb_resampler_destroy (r);
11571156}
@@ -1416,10 +1415,10 @@ const int rates[] = {16000, 32000, 44100, 48000, 96000, 192000, 384000};
14161415constexpr int WASAPI_MS_BLOCK = 10 ;
14171416const int block_sizes[] = {WASAPI_MS_BLOCK , 96 , 128 , 192 , 256 , 512 , 1024 , 2048 };
14181417#ifdef THOROUGH_TESTING
1419- const int input_duplex_rates[] = {16000 , 32000 , 44100 , 48000 ,
1418+ const int input_duplex_rates[] = {16000 , 32000 , 44100 , 48000 ,
14201419 96000 , 192000 , 384000 };
1421- const int input_duplex_block_sizes[] = {WASAPI_MS_BLOCK , 96 , 128 , 192 ,
1422- 256 , 512 , 1024 , 2048 };
1420+ const int input_duplex_block_sizes[] = {
1421+ WASAPI_MS_BLOCK , 96 , 128 , 192 , 256 , 512 , 1024 , 2048 };
14231422#else
14241423const int input_duplex_rates[] = {16000 , 44100 , 48000 , 96000 , 384000 };
14251424const int input_duplex_block_sizes[] = {WASAPI_MS_BLOCK , 96 , 128 , 192 , 512 };
@@ -1604,7 +1603,8 @@ data_cb_ignore_input(cubeb_stream *, void * user_ptr, const void *,
16041603}
16051604
16061605static void
1607- run_test_duplex (int input_rate, int output_rate, int target_rate, int block_size)
1606+ run_test_duplex (int input_rate, int output_rate, int target_rate,
1607+ int block_size)
16081608{
16091609 int effective_block_size = block_size;
16101610 if (effective_block_size == WASAPI_MS_BLOCK ) {
@@ -1623,11 +1623,9 @@ run_test_duplex(int input_rate, int output_rate, int target_rate, int block_size
16231623 out_params.rate = output_rate;
16241624 out_params.format = CUBEB_SAMPLE_FLOAT32NE ;
16251625
1626- cubeb_resampler * resampler =
1627- cubeb_resampler_create (nullptr , &in_params, &out_params, target_rate,
1628- data_cb_ignore_input, &state,
1629- CUBEB_RESAMPLER_QUALITY_DEFAULT ,
1630- CUBEB_RESAMPLER_RECLOCK_NONE );
1626+ cubeb_resampler * resampler = cubeb_resampler_create (
1627+ nullptr , &in_params, &out_params, target_rate, data_cb_ignore_input,
1628+ &state, CUBEB_RESAMPLER_QUALITY_DEFAULT , CUBEB_RESAMPLER_RECLOCK_NONE );
16311629 ASSERT_NE (resampler, nullptr );
16321630
16331631 std::vector<float > in_data;
@@ -1643,8 +1641,8 @@ run_test_duplex(int input_rate, int output_rate, int target_rate, int block_size
16431641 effective_block_size);
16441642
16451643 for (int i = 0 ; i < ITERATION_COUNT ; i++) {
1646- long frames_needed =
1647- cubeb_resampler_input_needed_for_output ( resampler, effective_block_size);
1644+ long frames_needed = cubeb_resampler_input_needed_for_output (
1645+ resampler, effective_block_size);
16481646 ASSERT_GE (frames_needed, 0 );
16491647 if ((long )in_data.size () < frames_needed) {
16501648 in_data.resize (frames_needed);
@@ -1684,11 +1682,9 @@ run_test_input(int input_rate, int target_rate, int block_size)
16841682 in_params.rate = input_rate;
16851683 in_params.format = CUBEB_SAMPLE_FLOAT32NE ;
16861684
1687- cubeb_resampler * resampler =
1688- cubeb_resampler_create (nullptr , &in_params, nullptr , target_rate,
1689- data_cb_input_only, nullptr ,
1690- CUBEB_RESAMPLER_QUALITY_DEFAULT ,
1691- CUBEB_RESAMPLER_RECLOCK_NONE );
1685+ cubeb_resampler * resampler = cubeb_resampler_create (
1686+ nullptr , &in_params, nullptr , target_rate, data_cb_input_only, nullptr ,
1687+ CUBEB_RESAMPLER_QUALITY_DEFAULT , CUBEB_RESAMPLER_RECLOCK_NONE );
16921688 ASSERT_NE (resampler, nullptr );
16931689
16941690 std::vector<float > in_data (effective_block_size);
0 commit comments