From 6925e42ff9411643ae4502400412564889ac6c15 Mon Sep 17 00:00:00 2001
From: Yun Liu <yun@yun.(none)>
Date: Wed, 15 Oct 2008 13:58:24 -0400
Subject: [PATCH] Fix multiple accounts initial registration problem

---
 src/audio/audiostream.cpp | 6 +++---
 src/managerimpl.cpp       | 5 ++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/audio/audiostream.cpp b/src/audio/audiostream.cpp
index 3384794c8c..520443d157 100644
--- a/src/audio/audiostream.cpp
+++ b/src/audio/audiostream.cpp
@@ -96,14 +96,14 @@ AudioStream::createStream( pa_context* c )
 				//pa_cvolume_set(&cv, sample_spec.channels , PA_VOLUME_NORM) , NULL );
   }
   else if( _streamType == CAPTURE_STREAM ){
-    
+/*    
     attributes->maxlength = 66500;//-1;
     attributes->tlength = -1; //44100;
     attributes->minreq = 2000;
     attributes->prebuf = 10000;
     attributes->fragsize = -1;   
- 
-    pa_stream_connect_record( s , NULL , attributes /*NULL*/ , PA_STREAM_START_CORKED );
+*/ 
+    pa_stream_connect_record( s , NULL , /*attributes*/ NULL , PA_STREAM_START_CORKED );
   }
   else if( _streamType == UPLOAD_STREAM ){
     pa_stream_connect_upload( s , 1024  );
diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp
index d349b09d54..c610742300 100644
--- a/src/managerimpl.cpp
+++ b/src/managerimpl.cpp
@@ -449,6 +449,7 @@ ManagerImpl::initRegisterAccounts()
 {
 
     int status; 
+    bool flag = true;
     AccountMap::iterator iter;
 
     _debugInit("Initiate VoIP Links Registration");
@@ -459,7 +460,8 @@ ManagerImpl::initRegisterAccounts()
         iter->second->loadConfig();
         if ( iter->second->isEnabled() ) {
 	  status = iter->second->registerVoIPLink();
-          ASSERT( status, SUCCESS );
+	  if (status != SUCCESS)
+		flag = false;
         }
       }
       iter++;
@@ -468,6 +470,7 @@ ManagerImpl::initRegisterAccounts()
     if( _audiodriver -> getErrorMessage() != -1 )
       notifyErrClient( _audiodriver -> getErrorMessage() );
     
+    ASSERT( flag, true );
     return SUCCESS;
 }
 
-- 
GitLab