[vlc-commits] nvdec: release used video blocks

Quentin Chateau git at videolan.org
Thu Mar 12 17:25:44 CET 2020


vlc | branch: master | Quentin Chateau <quentin.chateau at deepskycorp.com> | Thu Mar 12 15:31:25 2020 +0100| [9984700a271d3543b170be233349772ae4bd6643] | committer: Steve Lhomme

nvdec: release used video blocks

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

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

 modules/hw/nvdec/nvdec.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c
index e5cda56ef3..162330788f 100644
--- a/modules/hw/nvdec/nvdec.c
+++ b/modules/hw/nvdec/nvdec.c
@@ -549,7 +549,9 @@ static int CuvidPushBlock(decoder_t *p_dec, block_t *p_block)
     cupacket.payload = p_block->p_buffer;
     cupacket.timestamp = p_block->i_pts == VLC_TICK_INVALID ? p_block->i_dts : p_block->i_pts;
 
-    return CALL_CUVID(cuvidParseVideoData, p_sys->cuparser, &cupacket);
+    int ret = CALL_CUVID(cuvidParseVideoData, p_sys->cuparser, &cupacket);
+    block_Release(p_block);
+    return ret;
 }
 
 static block_t * HXXXProcessBlock(decoder_t *p_dec, block_t *p_block)
@@ -612,8 +614,12 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
 {
     nvdec_ctx_t *p_sys = p_dec->p_sys;
     // If HandleVideoSequence fails, we give up decoding
-    if (!p_sys->b_nvparser_success)
+    if (!p_sys->b_nvparser_success) {
+        if (p_block != NULL) {
+            block_Release(p_block);
+        }
         return VLCDEC_ECRITICAL;
+    }
     if (p_block == NULL) {
         // Flush stream
         return CuvidPushEOS(p_dec);



More information about the vlc-commits mailing list