Merge "Fix Tv source audio device adjust volume, and audio is breaks up intermittently." am: 67dccd5e64 am: 9b17bea1e0 am: 812ab29002
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1008694 Change-Id: I6b284e6912cd2e712a50210c17c93a3455a656c6
This commit is contained in:
@@ -1075,17 +1075,22 @@ class TvInputHardwareManager implements TvInputHal.Callback {
|
|||||||
}
|
}
|
||||||
if (shouldRecreateAudioPatch) {
|
if (shouldRecreateAudioPatch) {
|
||||||
mCommittedVolume = volume;
|
mCommittedVolume = volume;
|
||||||
if (mAudioPatch != null) {
|
// only recreate if something was updated or audioPath is null
|
||||||
mAudioManager.releaseAudioPatch(mAudioPatch);
|
if (mAudioPatch == null || sinkUpdated ||sourceUpdated ) {
|
||||||
}
|
if (mAudioPatch != null) {
|
||||||
mAudioManager.createAudioPatch(
|
mAudioManager.releaseAudioPatch(mAudioPatch);
|
||||||
|
audioPatchArray[0] = null;
|
||||||
|
}
|
||||||
|
mAudioManager.createAudioPatch(
|
||||||
audioPatchArray,
|
audioPatchArray,
|
||||||
new AudioPortConfig[] { sourceConfig },
|
new AudioPortConfig[] { sourceConfig },
|
||||||
sinkConfigs.toArray(new AudioPortConfig[sinkConfigs.size()]));
|
sinkConfigs.toArray(new AudioPortConfig[sinkConfigs.size()]));
|
||||||
mAudioPatch = audioPatchArray[0];
|
mAudioPatch = audioPatchArray[0];
|
||||||
if (sourceGainConfig != null) {
|
|
||||||
mAudioManager.setAudioPortGain(mAudioSource, sourceGainConfig);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sourceGainConfig != null) {
|
||||||
|
mAudioManager.setAudioPortGain(mAudioSource, sourceGainConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user