Automated import from //branches/cupcake/...@141597,141597
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp
index 851b213..c5c95b0 100644
--- a/camera/libcameraservice/CameraService.cpp
+++ b/camera/libcameraservice/CameraService.cpp
@@ -283,8 +283,14 @@
 #endif
     }
 
-    mMediaPlayerBeep.clear();
-    mMediaPlayerClick.clear();
+    if (mMediaPlayerBeep.get() != NULL) {
+        mMediaPlayerBeep->disconnect();
+        mMediaPlayerBeep.clear();
+    }
+    if (mMediaPlayerClick.get() != NULL) {
+        mMediaPlayerClick->disconnect();
+        mMediaPlayerClick.clear();
+    }
 
     // make sure we tear down the hardware
     mClientPid = IPCThreadState::self()->getCallingPid();
@@ -711,9 +717,6 @@
         return INVALID_OPERATION;
     }
 
-    if (mMediaPlayerClick.get() != NULL) {
-        mMediaPlayerClick->start();
-    }
     return mHardware->takePicture(shutterCallback,
                                   yuvPictureCallback,
                                   jpegPictureCallback,
@@ -751,6 +754,10 @@
 
         client->mSurface->registerBuffers(buffers);
     }
+
+    if (client->mMediaPlayerClick.get() != NULL) {
+        client->mMediaPlayerClick->start();
+    }
 }
 
 // picture callback - raw image ready