not writeframe is not streaming

Signed-off-by: smartbao <baomin@huawei.com>
This commit is contained in:
smartbao
2022-07-13 20:57:14 +08:00
parent f53aad99c1
commit d3a3bddfee
@@ -29,7 +29,7 @@ using namespace bluetooth;
sptr<IBluetoothA2dpSrc> g_proxy_ = nullptr;
static sptr<BluetoothA2dpSrcObserver> g_btA2dpSrcObserverCallbacks = nullptr;
int g_playState = false;
int g_playState = A2DP_NOT_PLAYING;
RawAddress g_device;
static void AudioOnConnectionStateChanged(const RawAddress &device, int state)
@@ -148,6 +148,10 @@ int WriteFrame(const uint8_t *data, uint32_t size)
HDF_LOGE("audio_bluetooth_manager %{public}s: g_proxy_ is null", __func__);
return RET_BAD_STATUS;
}
if (g_playState == A2DP_NOT_PLAYING) {
HDF_LOGE("audio_bluetooth_manager %{public}s: playState is not Streaming", __func__);
return RET_BAD_STATUS;
}
return g_proxy_->WriteFrame(data, size);
}