[vlc-commits] codec: dav1d: drain on EOS

Francois Cartegnie git at videolan.org
Tue Dec 18 18:14:48 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Dec 17 18:28:11 2018 +0100| [67373db984dee4f796c8a0c72aa744267deedcb3] | committer: Hugo Beauzée-Luyssen

codec: dav1d: drain on EOS

refs #21568

(cherry picked from commit 0fb3aaeff3fdadf91a39dcdba4384bef94ee71aa)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 modules/codec/dav1d.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
index 3fb966b8ea..41224ea312 100644
--- a/modules/codec/dav1d.c
+++ b/modules/codec/dav1d.c
@@ -192,6 +192,7 @@ static int Decode(decoder_t *dec, block_t *block)
         return VLCDEC_SUCCESS;
     }
 
+    bool b_eos = false;
     Dav1dData data;
     Dav1dData *p_data = NULL;
 
@@ -206,10 +207,12 @@ static int Decode(decoder_t *dec, block_t *block)
         }
         mtime_t pts = block->i_pts == VLC_TS_INVALID ? block->i_dts : block->i_pts;
         p_data->m.timestamp = pts;
+        b_eos = (block->i_flags & BLOCK_FLAG_END_OF_SEQUENCE);
     }
 
     Dav1dPicture img = { 0 };
 
+    bool b_draining = false;
     int i_ret = VLCDEC_SUCCESS;
     int res;
     do {
@@ -249,7 +252,7 @@ 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))
+        if(!b_draining && (res == -EAGAIN || res == 0) && (p_data == NULL||b_eos))
         {
             b_draining = true;
             res = 0;



More information about the vlc-commits mailing list