From 6f049e4e45d92d8d248c74d1ff6a1b175c16414f Mon Sep 17 00:00:00 2001 From: Seungbae Shin Date: Thu, 8 Feb 2018 17:30:48 +0900 Subject: [PATCH] Throw invalid operation error when unprepare() is called at inside of pulse-thread seperate tool package for containing test binary [Version] 0.5.3 [Issue Type] Bug Fix Change-Id: If5861e2d217d52da7dd9162aeeb74bb0498e3059 --- packaging/capi-media-audio-io.spec | 14 ++++++++++++-- src/cpp/CAudioInput.cpp | 2 ++ src/cpp/CAudioOutput.cpp | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packaging/capi-media-audio-io.spec b/packaging/capi-media-audio-io.spec index afd8da2..e37b52f 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.5.2 +Version: 0.5.3 Release: 0 Group: Multimedia/API License: Apache-2.0 @@ -28,6 +28,14 @@ Requires: %{name} = %{version}-%{release} %description devel An Audio Input & Audio Output library in Tizen Native API (DEV) +%package tool +Summary: An Audio Input & Audio Output library in Tizen Native API (Tool) +Group: Multimedia/Development +Requires: %{name} = %{version}-%{release} + +%description tool +An Audio Input & Audio Output library in Tizen Native API (Tool) + %prep %setup -q cp %{SOURCE1001} . @@ -60,5 +68,7 @@ make %{?jobs:-j%jobs} %{_includedir}/media/audio_io.h %{_libdir}/pkgconfig/*.pc %{_libdir}/libcapi-media-audio-io.so -%{_prefix}/bin/audio_io_test +%files tool +%manifest %{name}.manifest +%{_prefix}/bin/audio_io_test diff --git a/src/cpp/CAudioInput.cpp b/src/cpp/CAudioInput.cpp index 9a07ad7..903ee7d 100644 --- a/src/cpp/CAudioInput.cpp +++ b/src/cpp/CAudioInput.cpp @@ -340,6 +340,8 @@ void CAudioInput::unprepare() { try { internalLock(); + if (mpPulseAudioClient && mpPulseAudioClient->isInThread()) + THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't unprepare inside pulseaudio thread"); SAFE_FINALIZE(mpPulseAudioClient); SAFE_DELETE(mpPulseAudioClient); internalUnlock(); diff --git a/src/cpp/CAudioOutput.cpp b/src/cpp/CAudioOutput.cpp index c2ece71..b5c239f 100644 --- a/src/cpp/CAudioOutput.cpp +++ b/src/cpp/CAudioOutput.cpp @@ -251,6 +251,8 @@ void CAudioOutput::unprepare() { try { internalLock(); + if (mpPulseAudioClient && mpPulseAudioClient->isInThread()) + THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't unprepare inside pulseaudio thread"); SAFE_FINALIZE(mpPulseAudioClient); SAFE_DELETE(mpPulseAudioClient); internalUnlock(); -- 2.7.4