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

Commit a6cbb277 authored by Ajay Panicker's avatar Ajay Panicker
Browse files

Check if socket is closed before getting presentation position

Bug: 76456293
Test: Listen to music on a device that supports delay reporting
Change-Id: I4ca1c31819594750a7beb1d11ca5b8d64a7f836c
(cherry picked from commit 2f87c99b)
parent 19b9a626
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -742,6 +742,10 @@ 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
    return -1;
  }

  if (a2dp_command(common, A2DP_CTRL_GET_PRESENTATION_POSITION) < 0) {
    return -1;
  }