From 58bd27b7138698b23472272aa48fa84bf5d9ba78 Mon Sep 17 00:00:00 2001 From: xiongweichao Date: Thu, 6 Jan 2022 14:10:18 +0800 Subject: [PATCH] btc_a2dp_control_set_datachnl_stat is only used by a2dp sink --- .../btc/profile/std/a2dp/btc_a2dp_control.c | 4 +++- .../btc/profile/std/a2dp/btc_a2dp_source.c | 19 +++++-------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_control.c b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_control.c index 458f9d39dd..814b408c9f 100644 --- a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_control.c +++ b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_control.c @@ -25,7 +25,7 @@ #if BTC_AV_INCLUDED typedef struct { - BOOLEAN data_channel_open; + BOOLEAN data_channel_open; /* used only by A2DP sink */ UINT8 a2dp_cmd_pending; /* we can have max one command pending */ } tBTC_AA_CTRL_CB; @@ -75,7 +75,9 @@ static void btc_a2dp_datapath_open(void) btc_a2dp_source_encoder_update(); } #endif +#if (BTC_AV_SINK_INCLUDED == TRUE) btc_aa_ctrl_cb.data_channel_open = TRUE; +#endif } BOOLEAN btc_a2dp_control_get_datachnl_stat(void) diff --git a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c index 8accd9b550..b35ac83fa5 100644 --- a/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c +++ b/components/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /****************************************************************************** ** @@ -1579,7 +1571,6 @@ static void btc_a2dp_source_thread_init(UNUSED_ATTR void *context) static void btc_a2dp_source_thread_cleanup(UNUSED_ATTR void *context) { - btc_a2dp_control_set_datachnl_stat(FALSE); /* Clear media task flag */ btc_a2dp_source_state = BTC_A2DP_SOURCE_STATE_OFF;