Merge branch 'tizen' into tizen_line_coverage
[platform/core/api/audio-io.git] / src / cpp / CAudioOutput.cpp
index 996cdc5..fdf70f9 100644 (file)
@@ -58,7 +58,7 @@ void CAudioOutput::onStream(CPulseAudioClient* pClient, size_t length) {
      */
     if (__mIsUsedSyncWrite == true) {
 #ifdef _AUDIO_IO_DEBUG_TIMING_
-        AUDIO_IO_LOGD("Sync Write Mode! - signal! - pClient:[%p], length:[%d]", pClient, length);
+        AUDIO_IO_LOGD("Sync Write Mode! - signal! - pClient:[%p], length:[%zu]", pClient, length);
 #endif
         internalSignal();
         return;
@@ -68,7 +68,7 @@ void CAudioOutput::onStream(CPulseAudioClient* pClient, size_t length) {
      * Accrues callback function
      */
 #ifdef _AUDIO_IO_DEBUG_TIMING_
-    AUDIO_IO_LOGD("pClient:[%p], length:[%d]", pClient, length);
+    AUDIO_IO_LOGD("pClient:[%p], length:[%zu]", pClient, length);
 #endif
     CAudioIO::onStream(pClient, length);
 }
@@ -140,6 +140,10 @@ void CAudioOutput::prepare() {
             streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_OUTPUT_DEFAULT_ASYNC;
         }
 #endif
+        /* Override the default value by audio type */
+        if (audioType == CAudioInfo::EAudioType::AUDIO_OUT_TYPE_VOIP)
+            streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_OUTPUT_VOIP;
+
         CPulseStreamSpec spec(streamSpec, mAudioInfo);
 
         internalLock();
@@ -272,7 +276,7 @@ size_t CAudioOutput::write(const void* buffer, size_t length) {
             THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION,
                                    "The written result is invalid ret:%d", ret);
 #ifdef _AUDIO_IO_DEBUG_TIMING_
-        AUDIO_IO_LOGD("CPulseAudioClient->write(buffer:%p, length:%d)", buffer, length);
+        AUDIO_IO_LOGD("CPulseAudioClient->write(buffer:%p, length:%zu)", buffer, length);
 #endif
         return length;
     }
@@ -296,7 +300,7 @@ size_t CAudioOutput::write(const void* buffer, size_t length) {
 
             while ((l = mpPulseAudioClient->getWritableSize()) == 0) {
 #ifdef _AUDIO_IO_DEBUG_TIMING_
-                AUDIO_IO_LOGD("writableSize is [%d].. wait", l);
+                AUDIO_IO_LOGD("writableSize is [%zu].. wait", l);
 #endif
                 internalWait();
             }
@@ -305,7 +309,7 @@ size_t CAudioOutput::write(const void* buffer, size_t length) {
                 l = lengthIter;
 
 #ifdef _AUDIO_IO_DEBUG_TIMING_
-            AUDIO_IO_LOGD("CPulseAudioClient->write(buffer:%p, length:%d)", buffer, l);
+            AUDIO_IO_LOGD("CPulseAudioClient->write(buffer:%p, length:%zu)", buffer, l);
 #endif
 
             int ret = mpPulseAudioClient->write(buffer, l);