Fix Tv source audio device adjust volume, and audio is breaks up
intermittently. Bug: 136423083 Change-Id: I2669cddac7410eb1ad0dc43601771ee725bf494b
This commit is contained in:
@@ -1075,17 +1075,22 @@ class TvInputHardwareManager implements TvInputHal.Callback {
|
||||
}
|
||||
if (shouldRecreateAudioPatch) {
|
||||
mCommittedVolume = volume;
|
||||
if (mAudioPatch != null) {
|
||||
mAudioManager.releaseAudioPatch(mAudioPatch);
|
||||
}
|
||||
mAudioManager.createAudioPatch(
|
||||
// only recreate if something was updated or audioPath is null
|
||||
if (mAudioPatch == null || sinkUpdated ||sourceUpdated ) {
|
||||
if (mAudioPatch != null) {
|
||||
mAudioManager.releaseAudioPatch(mAudioPatch);
|
||||
audioPatchArray[0] = null;
|
||||
}
|
||||
mAudioManager.createAudioPatch(
|
||||
audioPatchArray,
|
||||
new AudioPortConfig[] { sourceConfig },
|
||||
sinkConfigs.toArray(new AudioPortConfig[sinkConfigs.size()]));
|
||||
mAudioPatch = audioPatchArray[0];
|
||||
if (sourceGainConfig != null) {
|
||||
mAudioManager.setAudioPortGain(mAudioSource, sourceGainConfig);
|
||||
mAudioPatch = audioPatchArray[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceGainConfig != null) {
|
||||
mAudioManager.setAudioPortGain(mAudioSource, sourceGainConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user