gralloc: Avoid multiple signals from videoOverlayStarted

Signal hdmi_ui_loop from fb_videoOverlayStarted only if there is a
state change

CRs-fixed: 279095
Change-Id: I43bc87b4d78fae139bcfc0318ad8b271a6a325c7
This commit is contained in:
Arun Kumar K.R 2011-03-16 13:23:20 -07:00
parent e9a3d5793c
commit 8897354c61

View File

@ -347,14 +347,16 @@ static int fb_videoOverlayStarted(struct framebuffer_device_t* dev, int started)
dev->common.module);
pthread_mutex_lock(&m->overlayLock);
Overlay* pTemp = m->pobjOverlay;
if (started && pTemp) {
pTemp->closeChannel();
m->videoOverlay = true;
pthread_cond_signal(&(m->overlayPost));
}
else {
m->videoOverlay = false;
pthread_cond_signal(&(m->overlayPost));
if(started != m->videoOverlay) {
if (started && pTemp) {
pTemp->closeChannel();
m->videoOverlay = true;
pthread_cond_signal(&(m->overlayPost));
}
else {
m->videoOverlay = false;
pthread_cond_signal(&(m->overlayPost));
}
}
pthread_mutex_unlock(&m->overlayLock);
return 0;