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

This commit is contained in:
Jae Seo
2016-06-02 00:04:16 +00:00
committed by Android (Google) Code Review

View File

@@ -742,7 +742,10 @@ class TvInputHardwareManager implements TvInputHal.Callback {
synchronized (mImplLock) {
mAudioSource = null;
mAudioSink.clear();
mAudioPatch = null;
if (mAudioPatch != null) {
mAudioManager.releaseAudioPatch(mAudioPatch);
mAudioPatch = null;
}
}
}
};
@@ -980,6 +983,9 @@ class TvInputHardwareManager implements TvInputHal.Callback {
}
if (shouldRecreateAudioPatch) {
mCommittedVolume = volume;
if (mAudioPatch != null) {
mAudioManager.releaseAudioPatch(mAudioPatch);
}
mAudioManager.createAudioPatch(
audioPatchArray,
new AudioPortConfig[] { sourceConfig },