summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-06-17 19:06:30 +0200
committerMax Kellermann <max@duempel.org>2016-06-17 19:11:20 +0200
commitd3c7fac60619f5cddd6550a9caa0bea67d6557e0 (patch)
tree62ed96fb6606564759314899d2b3c37debb71ff3 /src/input
parentfea3f6cc72089ca5736e74450bb5ff51581ec146 (diff)
thread/Thread: throw std::system_error on error
Diffstat (limited to 'src/input')
-rw-r--r--src/input/ThreadInputStream.cxx10
-rw-r--r--src/input/ThreadInputStream.hxx4
-rw-r--r--src/input/plugins/MmsInputPlugin.cxx9
3 files changed, 7 insertions, 16 deletions
diff --git a/src/input/ThreadInputStream.cxx b/src/input/ThreadInputStream.cxx
index 1bb11057a..f70abea36 100644
--- a/src/input/ThreadInputStream.cxx
+++ b/src/input/ThreadInputStream.cxx
@@ -44,8 +44,8 @@ ThreadInputStream::~ThreadInputStream()
}
}
-InputStream *
-ThreadInputStream::Start(Error &error)
+void
+ThreadInputStream::Start()
{
assert(buffer == nullptr);
@@ -53,11 +53,7 @@ ThreadInputStream::Start(Error &error)
assert(p != nullptr);
buffer = new CircularBuffer<uint8_t>((uint8_t *)p, buffer_size);
-
- if (!thread.Start(ThreadFunc, this, error))
- return nullptr;
-
- return this;
+ thread.Start(ThreadFunc, this);
}
inline void
diff --git a/src/input/ThreadInputStream.hxx b/src/input/ThreadInputStream.hxx
index 3756b7c56..6ad45545c 100644
--- a/src/input/ThreadInputStream.hxx
+++ b/src/input/ThreadInputStream.hxx
@@ -78,10 +78,8 @@ public:
/**
* Initialize the object and start the thread.
- *
- * @return false on error
*/
- InputStream *Start(Error &error);
+ void Start();
/* virtual methods from InputStream */
bool Check(Error &error) override final;
diff --git a/src/input/plugins/MmsInputPlugin.cxx b/src/input/plugins/MmsInputPlugin.cxx
index 8f16283f8..25af267e1 100644
--- a/src/input/plugins/MmsInputPlugin.cxx
+++ b/src/input/plugins/MmsInputPlugin.cxx
@@ -73,7 +73,7 @@ MmsInputStream::Open(Error &error)
static InputStream *
input_mms_open(const char *url,
Mutex &mutex, Cond &cond,
- Error &error)
+ gcc_unused Error &error)
{
if (!StringStartsWith(url, "mms://") &&
!StringStartsWith(url, "mmsh://") &&
@@ -82,11 +82,8 @@ input_mms_open(const char *url,
return nullptr;
auto m = new MmsInputStream(url, mutex, cond);
- auto is = m->Start(error);
- if (is == nullptr)
- delete m;
-
- return is;
+ m->Start();
+ return m;
}
size_t