aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/plugins/FfmpegInputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-18 09:47:28 +0200
committerMax Kellermann <max@duempel.org>2014-08-18 09:47:28 +0200
commit12ba1957d0d15af67be9f3c567a21379b69ea8fd (patch)
treec4fc39fb6fe97f2f24234d09b9cc7adeed6595d8 /src/input/plugins/FfmpegInputPlugin.cxx
parent9b9d189a333705818783e51da10d21511379124f (diff)
downloadmpd-12ba1957d0d15af67be9f3c567a21379b69ea8fd.tar.gz
mpd-12ba1957d0d15af67be9f3c567a21379b69ea8fd.tar.xz
mpd-12ba1957d0d15af67be9f3c567a21379b69ea8fd.zip
input/ffmpeg: use "auto"
Diffstat (limited to 'src/input/plugins/FfmpegInputPlugin.cxx')
-rw-r--r--src/input/plugins/FfmpegInputPlugin.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/input/plugins/FfmpegInputPlugin.cxx b/src/input/plugins/FfmpegInputPlugin.cxx
index 6e0260aee..b01bd2ffc 100644
--- a/src/input/plugins/FfmpegInputPlugin.cxx
+++ b/src/input/plugins/FfmpegInputPlugin.cxx
@@ -101,9 +101,9 @@ input_ffmpeg_open(const char *uri,
return nullptr;
AVIOContext *h;
- int ret = avio_open(&h, uri, AVIO_FLAG_READ);
- if (ret != 0) {
- error.Set(ffmpeg_domain, ret,
+ auto result = avio_open(&h, uri, AVIO_FLAG_READ);
+ if (result != 0) {
+ error.Set(ffmpeg_domain, result,
"libavformat failed to open the URI");
return nullptr;
}
@@ -114,17 +114,17 @@ input_ffmpeg_open(const char *uri,
size_t
FfmpegInputStream::Read(void *ptr, size_t read_size, Error &error)
{
- int ret = avio_read(h, (unsigned char *)ptr, read_size);
- if (ret <= 0) {
- if (ret < 0)
+ auto result = avio_read(h, (unsigned char *)ptr, read_size);
+ if (result <= 0) {
+ if (result < 0)
error.Set(ffmpeg_domain, "avio_read() failed");
eof = true;
return false;
}
- offset += ret;
- return (size_t)ret;
+ offset += result;
+ return (size_t)result;
}
bool
@@ -136,9 +136,9 @@ FfmpegInputStream::IsEOF()
bool
FfmpegInputStream::Seek(offset_type new_offset, Error &error)
{
- int64_t ret = avio_seek(h, new_offset, SEEK_SET);
+ auto result = avio_seek(h, new_offset, SEEK_SET);
- if (ret >= 0) {
+ if (result >= 0) {
eof = false;
return true;
} else {