Write dummy write if stream is not written at first callback during prepare situtaion 64/116464/1 accepted/tizen/3.0/common/20170227.140211 accepted/tizen/3.0/ivi/20170227.070807 accepted/tizen/3.0/mobile/20170227.065822 accepted/tizen/3.0/tv/20170227.070032 accepted/tizen/3.0/wearable/20170227.070502 submit/tizen_3.0/20170224.122826
authorSeungbae Shin <seungbae.shin@samsung.com>
Fri, 24 Feb 2017 11:00:58 +0000 (20:00 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Fri, 24 Feb 2017 11:00:58 +0000 (20:00 +0900)
[Version] 0.3.68
[Profile] Common
[Issue Type] Bug

Change-Id: I3118c91af39d6022db9d4fb889a1a437a47dc605

packaging/capi-media-audio-io.spec
src/cpp/CPulseAudioClient.cpp

index 4525359..e1c78c7 100644 (file)
@@ -1,6 +1,6 @@
 Name:           capi-media-audio-io
 Summary:        An Audio Input & Audio Output library in Tizen Native API
-Version:        0.3.67
+Version:        0.3.68
 Release:        0
 Group:          Multimedia/API
 License:        Apache-2.0
index 8fc6bec..8c0d379 100644 (file)
@@ -171,6 +171,19 @@ void CPulseAudioClient::__streamPlaybackCb(pa_stream* s, size_t length, void* us
     assert(pClient->__mpListener);
 
     pClient->__mpListener->onStream(pClient, length);
+
+    /* If stream is not written in first callback during prepare,
+       then write dummy data to ensure the start */
+    if (pClient->__mIsFirstStream) {
+        AUDIO_IO_LOGD("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;
+
+        pClient->__mIsFirstStream = false;
+    }
 }
 
 void CPulseAudioClient::__streamLatencyUpdateCb(pa_stream* s, void* user_data) {