Merge "Fix Tv source audio device adjust volume, and audio is breaks up intermittently."
This commit is contained in:
@@ -1075,19 +1075,24 @@ class TvInputHardwareManager implements TvInputHal.Callback {
|
|||||||
}
|
}
|
||||||
if (shouldRecreateAudioPatch) {
|
if (shouldRecreateAudioPatch) {
|
||||||
mCommittedVolume = volume;
|
mCommittedVolume = volume;
|
||||||
|
// only recreate if something was updated or audioPath is null
|
||||||
|
if (mAudioPatch == null || sinkUpdated ||sourceUpdated ) {
|
||||||
if (mAudioPatch != null) {
|
if (mAudioPatch != null) {
|
||||||
mAudioManager.releaseAudioPatch(mAudioPatch);
|
mAudioManager.releaseAudioPatch(mAudioPatch);
|
||||||
|
audioPatchArray[0] = null;
|
||||||
}
|
}
|
||||||
mAudioManager.createAudioPatch(
|
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) {
|
if (sourceGainConfig != null) {
|
||||||
mAudioManager.setAudioPortGain(mAudioSource, sourceGainConfig);
|
mAudioManager.setAudioPortGain(mAudioSource, sourceGainConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setStreamVolume(float volume) throws RemoteException {
|
public void setStreamVolume(float volume) throws RemoteException {
|
||||||
|
|||||||
Reference in New Issue
Block a user