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

Commit f73db8d0 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by android-build-merger
Browse files

Fetch the presentation position only if the audio state is STARTED

am: a56627c1

Change-Id: I693595f6bf4c5a95c08d5859887f9f5ef41242bd
parents caa6a90f a56627c1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -748,7 +748,8 @@ static int a2dp_write_output_audio_config(struct a2dp_stream_common* common) {
static int a2dp_get_presentation_position_cmd(struct a2dp_stream_common* common,
                                              uint64_t* bytes, uint16_t* delay,
                                              struct timespec* timestamp) {
  if (common->ctrl_fd == AUDIO_SKT_DISCONNECTED) {  // Already disconnected
  if ((common->ctrl_fd == AUDIO_SKT_DISCONNECTED) ||
      (common->state != AUDIO_A2DP_STATE_STARTED)) {  // Audio is not streaming
    return -1;
  }