diff options
author | Max Kellermann <max@duempel.org> | 2014-08-18 20:20:51 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-18 20:35:34 +0200 |
commit | e6e9c21275e2c2cf8be2f46f801bfc0de8f24718 (patch) | |
tree | 20d63642d863576c6f1c753d497bf0253eeb66c6 /src/input/plugins | |
parent | 636f5d4a1d983cdbb43b23da0da9c5db4a91f71f (diff) | |
download | mpd-e6e9c21275e2c2cf8be2f46f801bfc0de8f24718.tar.gz mpd-e6e9c21275e2c2cf8be2f46f801bfc0de8f24718.tar.xz mpd-e6e9c21275e2c2cf8be2f46f801bfc0de8f24718.zip |
input/ffmpeg: use av_strerror()
Generate more detailed error messages.
Diffstat (limited to 'src/input/plugins')
-rw-r--r-- | src/input/plugins/FfmpegInputPlugin.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input/plugins/FfmpegInputPlugin.cxx b/src/input/plugins/FfmpegInputPlugin.cxx index 130521ca2..669f8d403 100644 --- a/src/input/plugins/FfmpegInputPlugin.cxx +++ b/src/input/plugins/FfmpegInputPlugin.cxx @@ -23,6 +23,7 @@ #include "config.h" #include "FfmpegInputPlugin.hxx" #include "lib/ffmpeg/Domain.hxx" +#include "lib/ffmpeg/Error.hxx" #include "../InputStream.hxx" #include "../InputPlugin.hxx" #include "util/StringUtil.hxx" @@ -101,8 +102,7 @@ input_ffmpeg_open(const char *uri, AVIOContext *h; auto result = avio_open(&h, uri, AVIO_FLAG_READ); if (result != 0) { - error.Set(ffmpeg_domain, result, - "libavformat failed to open the URI"); + SetFfmpegError(error, result); return nullptr; } @@ -115,7 +115,7 @@ FfmpegInputStream::Read(void *ptr, size_t read_size, Error &error) auto result = avio_read(h, (unsigned char *)ptr, read_size); if (result <= 0) { if (result < 0) - error.Set(ffmpeg_domain, "avio_read() failed"); + SetFfmpegError(error, result, "avio_read() failed"); eof = true; return false; @@ -137,7 +137,7 @@ FfmpegInputStream::Seek(offset_type new_offset, Error &error) auto result = avio_seek(h, new_offset, SEEK_SET); if (result < 0) { - error.Set(ffmpeg_domain, "avio_seek() failed"); + SetFfmpegError(error, result, "avio_seek() failed"); return false; } |