input/Plugin: migrate open() from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-09-09 15:37:06 +02:00
parent 63ab7767a3
commit fc7d3f64c0
44 changed files with 359 additions and 461 deletions

View File

@@ -84,8 +84,7 @@ input_ffmpeg_init(gcc_unused const ConfigBlock &block)
static InputStream *
input_ffmpeg_open(const char *uri,
Mutex &mutex, Cond &cond,
Error &error)
Mutex &mutex, Cond &cond)
{
if (!StringStartsWith(uri, "gopher://") &&
!StringStartsWith(uri, "rtp://") &&
@@ -97,10 +96,8 @@ input_ffmpeg_open(const char *uri,
AVIOContext *h;
auto result = avio_open(&h, uri, AVIO_FLAG_READ);
if (result != 0) {
SetFfmpegError(error, result);
return nullptr;
}
if (result != 0)
throw MakeFfmpegError(result);
return new FfmpegInputStream(uri, mutex, cond, h);
}