Throw invalid operation error when unprepare() is called at inside of pulse-thread 29/170929/1
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 8 Feb 2018 08:30:48 +0000 (17:30 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Fri, 23 Feb 2018 07:43:17 +0000 (16:43 +0900)
seperate tool package for containing test binary

[Version] 0.5.3
[Issue Type] Bug Fix

Change-Id: If5861e2d217d52da7dd9162aeeb74bb0498e3059

packaging/capi-media-audio-io.spec
src/cpp/CAudioInput.cpp
src/cpp/CAudioOutput.cpp

index afd8da2..e37b52f 100644 (file)
@@ -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
index 9a07ad7..903ee7d 100644 (file)
@@ -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();
index c2ece71..b5c239f 100644 (file)
@@ -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();