Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03bd9638 authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Gerrit Code Review
Browse files

Merge "Do not reject valid SBC codec parameters"

parents e18bf10b 52462362
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ static const tA2DP_SBC_CIE a2dp_sbc_sink_caps = {
    (A2DP_SBC_IE_SUBBAND_4 | A2DP_SBC_IE_SUBBAND_8),   /* num_subbands */
    (A2DP_SBC_IE_ALLOC_MD_L | A2DP_SBC_IE_ALLOC_MD_S), /* alloc_method */
    A2DP_SBC_IE_MIN_BITPOOL,                           /* min_bitpool */
    A2DP_SBC_IE_MAX_BITPOOL                            /* max_bitpool */
    A2DP_SBC_MAX_BITPOOL                               /* max_bitpool */
};

/* Default SBC codec configuration */
@@ -476,10 +476,10 @@ static tA2DP_STATUS A2DP_CodecInfoMatchesCapabilitySbc(
    return A2DP_NS_ALLOC_METHOD;

  /* min bitpool */
  if (cfg_cie.min_bitpool < p_cap->min_bitpool) return A2DP_NS_MIN_BITPOOL;
  if (cfg_cie.min_bitpool > p_cap->max_bitpool) return A2DP_NS_MIN_BITPOOL;

  /* max bitpool */
  if (cfg_cie.max_bitpool > p_cap->max_bitpool) return A2DP_NS_MAX_BITPOOL;
  if (cfg_cie.max_bitpool < p_cap->min_bitpool) return A2DP_NS_MAX_BITPOOL;

  return A2DP_SUCCESS;
}
+3 −0
Original line number Diff line number Diff line
@@ -133,16 +133,19 @@ TEST(StackA2dpTest, test_a2dp_get_codec_type) {

TEST(StackA2dpTest, test_a2dp_is_source_codec_supported) {
  EXPECT_TRUE(A2DP_IsSourceCodecSupported(codec_info_sbc));
  EXPECT_TRUE(A2DP_IsSourceCodecSupported(codec_info_sbc_sink));
  EXPECT_FALSE(A2DP_IsSourceCodecSupported(codec_info_non_a2dp));
}

TEST(StackA2dpTest, test_a2dp_is_sink_codec_supported) {
  EXPECT_TRUE(A2DP_IsSinkCodecSupported(codec_info_sbc));
  EXPECT_TRUE(A2DP_IsSinkCodecSupported(codec_info_sbc_sink));
  EXPECT_FALSE(A2DP_IsSinkCodecSupported(codec_info_non_a2dp));
}

TEST(StackA2dpTest, test_a2dp_is_peer_source_codec_supported) {
  EXPECT_TRUE(A2DP_IsPeerSourceCodecSupported(codec_info_sbc));
  EXPECT_TRUE(A2DP_IsPeerSourceCodecSupported(codec_info_sbc_sink));
  EXPECT_FALSE(A2DP_IsPeerSourceCodecSupported(codec_info_non_a2dp));
}