audio-io uses new 'default' latency configuration.
[platform/core/api/audio-io.git] / src / cpp / CPulseAudioClient.cpp
index bfe72b2..fe28ea9 100644 (file)
@@ -162,17 +162,6 @@ void CPulseAudioClient::__streamPlaybackCb(pa_stream* s, size_t length, void* us
     CPulseAudioClient* pClient = static_cast<CPulseAudioClient*>(user_data);
     assert(pClient->__mpListener);
 
-    if (pClient->__mIsInit == false) {
-        AUDIO_IO_LOGD("Occurred this listener when an out stream is on the way to create : Write dummy, length[%d]", length);
-
-        char* dummy = new char[length];
-        memset(dummy, 0, length);
-        pa_stream_write(s, dummy, length, NULL, 0LL, PA_SEEK_RELATIVE);
-        delete [] dummy;
-
-        return;
-    }
-
     pClient->__mpListener->onStream(pClient, length);
 }
 
@@ -563,12 +552,6 @@ int CPulseAudioClient::drop() throw(CAudioError) {
 }
 
 int CPulseAudioClient::write(const void* data, size_t length) throw(CAudioError) {
-    if (__mIsInit == false) {
-        THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient");
-    }
-
-    checkRunningState();
-
     if (data == NULL) {
         THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_ARGUMENT, "The parameter is invalid");
     }
@@ -712,10 +695,6 @@ size_t CPulseAudioClient::getWritableSize() throw(CAudioError) {
 }
 
 void CPulseAudioClient::checkRunningState() throw(CAudioError) {
-    if (__mIsInit == false) {
-        THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient");
-    }
-
     if (__mpContext == NULL || PA_CONTEXT_IS_GOOD(pa_context_get_state(__mpContext)) == 0) {
         THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_INITIALIZED, "The context[%p] is not created or not good state", __mpContext);
     }
@@ -732,10 +711,6 @@ void CPulseAudioClient::checkRunningState() throw(CAudioError) {
 }
 
 bool CPulseAudioClient::isInThread() throw(CAudioError) {
-    if (__mIsInit == false) {
-        THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient");
-    }
-
     int ret = pa_threaded_mainloop_in_thread(__mpMainloop);
 
 #ifdef _AUDIO_IO_DEBUG_TIMING_