[vlc-devel] [PATCH] nvdec: release used video blocks
Quentin Chateau
quentin.chateau at deepskycorp.com
Thu Mar 12 17:04:26 CET 2020
Indeed
On 12/03/2020 16:35, Thomas Guillem wrote:
> So, nvdec was leaking every input blocks then ?
>
> On Thu, Mar 12, 2020, at 15:31, quentin.chateau at deepskycorp.com wrote:
>> From: Quentin Chateau <quentin.chateau at deepskycorp.com>
>>
>> ---
>> 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);
>> --
>> 2.17.1
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list