Commit 12ba1957 authored by Max Kellermann's avatar Max Kellermann

input/ffmpeg: use "auto"

parent 9b9d189a
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment