OSDN Git Service

Fix issue 3400751.
authorEric Laurent <elaurent@google.com>
Fri, 11 Feb 2011 22:39:34 +0000 (14:39 -0800)
committerEric Laurent <elaurent@google.com>
Fri, 11 Feb 2011 22:53:23 +0000 (14:53 -0800)
Add a delay before restoring output path when a notification ends so that
short sounds can be heard on proper device before the path is actualy switched.

Change-Id: I1d2dd8e7e28e15fbcab344256f88499b26297372

services/audioflinger/AudioPolicyManagerBase.cpp

index 6a82a59..3082d45 100644 (file)
@@ -610,7 +610,7 @@ status_t AudioPolicyManagerBase::stopOutput(audio_io_handle_t output,
         // store time at which the stream was stopped - see isStreamActive()
         outputDesc->mStopTime[stream] = systemTime();
 
-        setOutputDevice(output, getNewDevice(output));
+        setOutputDevice(output, getNewDevice(output), false, outputDesc->mLatency*2);
 
 #ifdef WITH_A2DP
         if (mA2dpOutput != 0 && !a2dpUsedForSonification() &&