Merge "TIF: Release an existing audio patch before creating a new one" into nyc-dev am: bd2b9e0d53

am: 5e0f4e2e29

* commit '5e0f4e2e29e5dcdfae67049511aeaf2f7409806f':
  TIF: Release an existing audio patch before creating a new one

Change-Id: I5dec46babcd88685c37f2754d5eb1179f4061cbb
This commit is contained in:
Jae Seo
2016-06-02 00:17:21 +00:00
committed by android-build-merger

View File

@@ -742,9 +742,12 @@ class TvInputHardwareManager implements TvInputHal.Callback {
synchronized (mImplLock) { synchronized (mImplLock) {
mAudioSource = null; mAudioSource = null;
mAudioSink.clear(); mAudioSink.clear();
if (mAudioPatch != null) {
mAudioManager.releaseAudioPatch(mAudioPatch);
mAudioPatch = null; mAudioPatch = null;
} }
} }
}
}; };
private int mOverrideAudioType = AudioManager.DEVICE_NONE; private int mOverrideAudioType = AudioManager.DEVICE_NONE;
private String mOverrideAudioAddress = ""; private String mOverrideAudioAddress = "";
@@ -980,6 +983,9 @@ class TvInputHardwareManager implements TvInputHal.Callback {
} }
if (shouldRecreateAudioPatch) { if (shouldRecreateAudioPatch) {
mCommittedVolume = volume; mCommittedVolume = volume;
if (mAudioPatch != null) {
mAudioManager.releaseAudioPatch(mAudioPatch);
}
mAudioManager.createAudioPatch( mAudioManager.createAudioPatch(
audioPatchArray, audioPatchArray,
new AudioPortConfig[] { sourceConfig }, new AudioPortConfig[] { sourceConfig },