[vlc-devel] [PATCH 1/2] aout: use vlc_atomic_rc_t

Quentin Chateau quentin.chateau at deepskycorp.com
Fri Feb 21 18:32:24 CET 2020


I fail to see what you mean, can you please give me some more info so I 
can meet your expectations:

 1. Are you afraid of the counter overflowing the underlying unsigned int ?
 2. How is it worse than before ?
 3. What's the point of having helper functions for reference counting
    if we should not use them ?

On 21/02/2020 18:00, Rémi Denis-Courmont wrote:
> Le perjantaina 21. helmikuuta 2020, 16.14.34 EET
> quentin.chateau at deepskycorp.com a écrit :
>> From: Quentin Chateau <quentin.chateau at deepskycorp.com>
>>
>> ---
>>   src/audio_output/aout_internal.h | 3 ++-
>>   src/audio_output/output.c        | 7 ++++---
>>   2 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/audio_output/aout_internal.h
>> b/src/audio_output/aout_internal.h index 57b4f3264d..8b563012e2 100644
>> --- a/src/audio_output/aout_internal.h
>> +++ b/src/audio_output/aout_internal.h
>> @@ -25,6 +25,7 @@
>>
>>   # include <stdatomic.h>
>>
>> +# include <vlc_atomic.h>
>>   # include <vlc_viewpoint.h>
>>   # include "../clock/clock.h"
>>
>> @@ -97,7 +98,7 @@ typedef struct
>>       atomic_uint buffers_played;
>>       atomic_uchar restart;
>>
>> -    atomic_uintptr_t refs;
>> +    vlc_atomic_rc_t rc;
> This causes a potential unchecked overflow of the counter.
>
> No thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200221/da561639/attachment.html>


More information about the vlc-devel mailing list