multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesecuremediasession.cpp
branchRCL_3
changeset 18 91f50911ea81
parent 3 513a8b745b2f
child 25 fb1bbf85a302
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesecuremediasession.cpp	Tue May 11 16:34:40 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesecuremediasession.cpp	Tue May 25 13:07:26 2010 +0300
@@ -433,7 +433,7 @@
 	{
 	MCEMM_DEBUG("CMceSecureDesStream::BindStreamCrypto(), Entry");
 	TInt err(KErrNone);
-	if (iSession.iClientCryptoSuites.Count())
+	if (iLSReadyToBind && iSession.iClientCryptoSuites.Count())
 		{
 		for (TInt i=0; i<iSession.MccStreams().Count(); i++)
 			{
@@ -441,20 +441,22 @@
 			MCEMM_DEBUG_DVALUE("	CMceSrvStream id =", stream->Data().Id().iId );	
 			MCEMM_DEBUG_DVALUE("	App id", stream->Data().Id().iAppId );		
 			TInt secStreamCount = iMceSecureDesStreams.Count();
-    		for (TInt j=0; j<secStreamCount; j++)
-				{
-				CMceSecureDesStream* secureStream=iMceSecureDesStreams[j]; 
-				MCEMM_DEBUG_DVALUE("	SrvStream id in SecureStream ", secureStream->MediaStream().Id().iId);	
-				MCEMM_DEBUG_DVALUE("	App id in SecureStream ", secureStream->MediaStream().Id().iAppId);	
-				if (stream->Data().Id()== secureStream->MediaStream().Id() || 
-					 ( stream->Data().BoundStream() && 
-					   stream->Data().iLinkedStream->Id() == secureStream->MediaStream().Id() ) ) 
-					{
-					//bind
-					secureStream->BindCrypto(*stream);
-					
-					}
-				}
+            for (TInt j=0; j<secStreamCount; j++)
+                {
+                CMceSecureDesStream* secureStream=iMceSecureDesStreams[j];
+                MCEMM_DEBUG_DVALUE("	SrvStream id in SecureStream ", secureStream->MediaStream().Id().iId);	
+                MCEMM_DEBUG_DVALUE("	App id in SecureStream ", secureStream->MediaStream().Id().iAppId);	
+                if(secureStream->iWaitingBinding)
+                    {
+                    if (stream->Data().Id()== secureStream->MediaStream().Id() || 
+                         ( stream->Data().BoundStream() && 
+                           stream->Data().iLinkedStream->Id() == secureStream->MediaStream().Id() ) ) 
+                        {
+                        //bind
+                        err = secureStream->BindCrypto(*stream);					
+                        }
+                    }
+                }
 			}
 		}
 	MCEMM_DEBUG("CMceSecureDesStream::BindStreamCrypto(), Exit");