)]}'
{
  "commit": "d3fc8ac6c52c20a6dc2de15d7cf306da8442e414",
  "tree": "b9c1b545313b136bf2acf4892223c7f64f6ee376",
  "parents": [
    "87029dbc462479fd46ea3150567fdbdfbca94a85"
  ],
  "author": {
    "name": "Eric Laurent",
    "email": "elaurent@google.com",
    "time": "Tue Dec 01 02:17:41 2009 -0800"
  },
  "committer": {
    "name": "Eric Laurent",
    "email": "elaurent@google.com",
    "time": "Tue Dec 01 02:17:41 2009 -0800"
  },
  "message": "Fix issue 2292062: Audio freezes for three seconds when choosing ringtones with a headset connected and music playing.\n\nThe problem comes from a deadlock with AudioPolicyService mutex: When the second ringtone starts,\nthis mutex is locked by AudioPolicyService::startOutput() which in turn calls setParameters() to change the output device.\nAudioflinger::ThreadBase::setParameters() signals the parameter change to the AudioFlinger mixer thread and waits for a condition\nindicating that the parameter change has been processed.\nAt the same time, the mixer thread detects that the audio track corresponding to the first ring tone has been killed and calls its destructor.\nThis calls AudioPolicyService::releaseOutput() which tries to lock the AudioPolicyService mutex.\nIf this happens before the mixer thread can process the setParameters() command we are deadlocked.\nThe deadlock ends because setParameters() uses a timeout when waiting for the condition.\n\nThis regression was introduced by change 33736 fixing issue 2265163.\n\nThe fix consists in calling AudioPolicyService::releaseOutput() from Track::destroy() instead of from Track destructor: as detroy() is never called from the mixer thread loop (as opposed to the destructor) the deadlock described above cannot occur.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "daec6e8853c55e15592a16baf24d93ff12893dac",
      "old_mode": 33188,
      "old_path": "libs/audioflinger/AudioFlinger.cpp",
      "new_id": "9ec8de57508ba0d4239bf2bc662c93349e340848",
      "new_mode": 33188,
      "new_path": "libs/audioflinger/AudioFlinger.cpp"
    }
  ]
}
