[vlc-commits] codec: dav1d: use provided error value macro

Francois Cartegnie git at videolan.org
Thu Feb 13 11:32:39 CET 2020


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Feb 12 18:12:12 2020 +0100| [bb98c9a1bda8972a83ec102e286da00228c1f2d3] | committer: Francois Cartegnie

codec: dav1d: use provided error value macro

(cherry picked from commit b7b240151a8432f79efbae4e2bbc793dacefb1b1)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=bb98c9a1bda8972a83ec102e286da00228c1f2d3
---

 modules/codec/dav1d.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
index 2ebc548fca..6334bef818 100644
--- a/modules/codec/dav1d.c
+++ b/modules/codec/dav1d.c
@@ -223,7 +223,7 @@ static int Decode(decoder_t *dec, block_t *block)
         if( p_data )
         {
             res = dav1d_send_data(p_sys->c, p_data);
-            if (res < 0 && res != -EAGAIN)
+            if (res < 0 && res != DAV1D_ERR(EAGAIN))
             {
                 msg_Err(dec, "Decoder feed error %d!", res);
                 i_ret = VLC_EGENERIC;
@@ -248,7 +248,7 @@ static int Decode(decoder_t *dec, block_t *block)
             decoder_QueueVideo(dec, pic);
             dav1d_picture_unref(&img);
         }
-        else if (res != -EAGAIN)
+        else if (res != DAV1D_ERR(EAGAIN))
         {
             msg_Err(dec, "Decoder error %d!", res);
             i_ret = VLC_EGENERIC;
@@ -256,7 +256,8 @@ static int Decode(decoder_t *dec, block_t *block)
         }
 
         /* on drain, we must ignore the 1st EAGAIN */
-        if(!b_draining && (res == -EAGAIN || res == 0) && (p_data == NULL||b_eos))
+        if(!b_draining && (res == DAV1D_ERR(EAGAIN) || res == 0)
+                       && (p_data == NULL||b_eos))
         {
             b_draining = true;
             res = 0;



More information about the vlc-commits mailing list