diff --git a/amp/src/aal/sound/sound_api.c b/amp/src/aal/sound/sound_api.c index 27c374c..ac3b5dd 100755 --- a/amp/src/aal/sound/sound_api.c +++ b/amp/src/aal/sound/sound_api.c @@ -3067,6 +3067,7 @@ HRESULT AMP_SND_SetStreamVolumeIndB(AMP_IN HANDLE hStream, AMP_IN float fVolume) SND_STRM *pStream = 0; UINT32 uiVolume = 0; AMP_APP_PARAST stAppParam; + AMP_SOUND_DRIVER *pSndDrv = g_stSndDriver; SND_API_ENTER(); SNDDRV_CHECKVALID(); @@ -3097,6 +3098,7 @@ HRESULT AMP_SND_SetStreamVolumeIndB(AMP_IN HANDLE hStream, AMP_IN float fVolume) (pStream->PeerPortConn.hInterHandle == SOUND_PORTID_PASSTHROUGH && pStream->PeerPortConn.uiFlags == HDMI_PATH)) { + MV_OSAL_Mutex_Lock(pSndDrv->hDrvMutex); #ifdef CONFIG_AMP_AUDIO_MUTE_PT_FOR_STREAM SNDLOGD("HDMI pass through case, stream volume is set to AOUT!\n"); AMP_RPC(rc, AMP_SNDSINK_SetAoutStreamVolume, pStream->hSndSinkComp, @@ -3109,6 +3111,11 @@ HRESULT AMP_SND_SetStreamVolumeIndB(AMP_IN HANDLE hStream, AMP_IN float fVolume) #if 1 //tony debug pStream->uiStreamVolume = uiVolume; #endif + if( pStream->uiStreamVolume != 0 ){ + AMP_RPC(rc, AMP_SNDSINK_SetAoutStreamVolume, pStream->hSndSinkComp, HDMI_PATH, 0x40000000L); + } + MV_OSAL_Mutex_Unlock(pSndDrv->hDrvMutex); + return rc; } @@ -3482,7 +3489,6 @@ HRESULT AMP_SND_SetStreamMute(AMP_IN HANDLE hStream, AMP_IN BOOL bMute) SNDSTRM_CHECKVALID(hStream); pStream = (SND_STRM *)hStream; stAppParam._d = AMP_APP_PARAIDX_VOLUME; - if((pStream->PeerPortConn.ePeerType == AMP_PORT_AREN_OUT_SPDIF)|| (pStream->PeerPortConn.hInterHandle == SOUND_PORTID_PASSTHROUGH && @@ -3530,6 +3536,7 @@ HRESULT AMP_SND_SetStreamMute(AMP_IN HANDLE hStream, AMP_IN BOOL bMute) (pStream->PeerPortConn.hInterHandle == SOUND_PORTID_PASSTHROUGH && pStream->PeerPortConn.uiFlags == HDMI_PATH)) { + MV_OSAL_Mutex_Lock(pSndDrv->hDrvMutex); #ifdef CONFIG_AMP_AUDIO_MUTE_PT_FOR_STREAM SNDLOGD("HDMI pass through case, stream volume is set to AOUT!\n"); #if 1 //tony debug @@ -3545,6 +3552,7 @@ HRESULT AMP_SND_SetStreamMute(AMP_IN HANDLE hStream, AMP_IN BOOL bMute) hStream); } #endif + MV_OSAL_Mutex_Unlock(pSndDrv->hDrvMutex); return rc; }