[FFmpeg-cvslog] avcodec/libdav1d: consistently use AVERROR return values

James Almer git at videolan.org
Wed Mar 13 00:24:32 EET 2019


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Mar 12 19:18:14 2019 -0300| [36bb2cc200d0ee4c43de06f030d7956949b1f88c] | committer: James Almer

avcodec/libdav1d: consistently use AVERROR return values

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=36bb2cc200d0ee4c43de06f030d7956949b1f88c
---

 libavcodec/libdav1d.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 9b697a8197..948e9f4ea2 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -185,9 +185,9 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
 
     res = dav1d_send_data(dav1d->c, data);
     if (res < 0) {
-        if (res == -EINVAL)
+        if (res == AVERROR(EINVAL))
             res = AVERROR_INVALIDDATA;
-        if (res != -EAGAIN)
+        if (res != AVERROR(EAGAIN))
             return res;
     }
 
@@ -197,9 +197,9 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
 
     res = dav1d_get_picture(dav1d->c, p);
     if (res < 0) {
-        if (res == -EINVAL)
+        if (res == AVERROR(EINVAL))
             res = AVERROR_INVALIDDATA;
-        else if (res == -EAGAIN && c->internal->draining)
+        else if (res == AVERROR(EAGAIN) && c->internal->draining)
             res = AVERROR_EOF;
 
         av_free(p);



More information about the ffmpeg-cvslog mailing list