soapy: start/stop hooks should use de/activate return code

This commit is contained in:
Josh Blum 2015-02-16 23:15:26 -08:00
parent cd0d9350c6
commit a960600a1e
2 changed files with 4 additions and 40 deletions

View File

@ -84,30 +84,12 @@ soapy_sink_c::~soapy_sink_c(void)
bool soapy_sink_c::start()
{
try
{
_device->activateStream(_stream);
}
catch (const std::exception &ex)
{
std::cerr << "soapy_sink_c::start(): " << ex.what() << std::endl;
return false;
}
return true;
return _device->activateStream(_stream) == 0;
}
bool soapy_sink_c::stop()
{
try
{
_device->deactivateStream(_stream);
}
catch (const std::exception &ex)
{
std::cerr << "soapy_sink_c::stop(): " << ex.what() << std::endl;
return false;
}
return true;
return _device->deactivateStream(_stream) == 0;
}
int soapy_sink_c::work( int noutput_items,

View File

@ -81,30 +81,12 @@ soapy_source_c::~soapy_source_c(void)
bool soapy_source_c::start()
{
try
{
_device->activateStream(_stream);
}
catch (const std::exception &ex)
{
std::cerr << "soapy_source_c::start(): " << ex.what() << std::endl;
return false;
}
return true;
return _device->activateStream(_stream) == 0;
}
bool soapy_source_c::stop()
{
try
{
_device->deactivateStream(_stream);
}
catch (const std::exception &ex)
{
std::cerr << "soapy_source_c::stop(): " << ex.what() << std::endl;
return false;
}
return true;
return _device->deactivateStream(_stream) == 0;
}
int soapy_source_c::work( int noutput_items,