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

Commit d3a81778 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add for fix audio track null point" into main am: fdfaf6c1

parents 7db87f97 fdfaf6c1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -138,4 +138,7 @@ void btif_a2dp_sink_set_focus_state_req(btif_a2dp_sink_focus_state_t state);
// |gain| is the audio track gain value to use.
void btif_a2dp_sink_set_audio_track_gain(float gain);

// Get audio track handle
void * btif_a2dp_sink_get_audio_track(void);

#endif /* BTIF_A2DP_SINK_H */
+5 −0
Original line number Diff line number Diff line
@@ -749,6 +749,11 @@ void btif_a2dp_sink_set_audio_track_gain(float gain) {
#endif
}

void * btif_a2dp_sink_get_audio_track(void)
{
  return btif_a2dp_sink_cb.audio_track;
}

static void btif_a2dp_sink_clear_track_event_req() {
  LOG_INFO("%s", __func__);
  BT_HDR_RIGID* p_buf =
+11 −0
Original line number Diff line number Diff line
@@ -1537,6 +1537,17 @@ bool BtifAvSink::AllowedToConnect(const RawAddress& peer_address) const {
        }
        connected++;
        break;
      case BtifAvStateMachine::kStateClosing:
      case BtifAvStateMachine::kStateIdle:
        if ((btif_a2dp_sink_get_audio_track() != nullptr) &&
          (peer->PeerAddress() != peer_address)) {
          LOG_INFO("%s: there is another peer with audio track(%p), another=%s, peer=%s",
            __PRETTY_FUNCTION__, btif_a2dp_sink_get_audio_track(),
            ADDRESS_TO_LOGGABLE_CSTR(peer->PeerAddress()),
            ADDRESS_TO_LOGGABLE_CSTR(peer_address));
          connected++;
        }
        break;
      default:
        break;
    }