From: Seungbae Shin Date: Fri, 24 Feb 2017 11:00:58 +0000 (+0900) Subject: Write dummy write if stream is not written at first callback during prepare situtaion X-Git-Tag: submit/tizen_3.0/20170224.122826^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F64%2F116464%2F1;p=platform%2Fcore%2Fapi%2Faudio-io.git Write dummy write if stream is not written at first callback during prepare situtaion [Version] 0.3.68 [Profile] Common [Issue Type] Bug Change-Id: I3118c91af39d6022db9d4fb889a1a437a47dc605 --- diff --git a/packaging/capi-media-audio-io.spec b/packaging/capi-media-audio-io.spec index 4525359..e1c78c7 100644 --- a/packaging/capi-media-audio-io.spec +++ b/packaging/capi-media-audio-io.spec @@ -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 diff --git a/src/cpp/CPulseAudioClient.cpp b/src/cpp/CPulseAudioClient.cpp index 8fc6bec..8c0d379 100644 --- a/src/cpp/CPulseAudioClient.cpp +++ b/src/cpp/CPulseAudioClient.cpp @@ -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) {