[vlc-devel] [PATCH 1/8] decoder: simplify how we report lost pictures
Steve Lhomme
robux4 at ycbcr.xyz
Tue Aug 27 10:33:36 CEST 2019
On 2019-08-27 10:25, Rémi Denis-Courmont wrote:
> Hi,
>
> The ternary seems redundant here?
If we report an int error it will be needed.
> Le 27 août 2019 08:27:12 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>> No need for pointers.
>> ---
>> src/input/decoder.c | 16 +++++++---------
>> 1 file changed, 7 insertions(+), 9 deletions(-)
>>
>> diff --git a/src/input/decoder.c b/src/input/decoder.c
>> index 782dc0a422..d05351fa5c 100644
>> --- a/src/input/decoder.c
>> +++ b/src/input/decoder.c
>> @@ -981,10 +981,9 @@ static void DecoderQueueCc( decoder_t *p_videodec,
>> block_t *p_cc,
>> }
>> }
>>
>> -static void DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
>> - unsigned *restrict pi_lost_sum )
>> +static bool DecoderPlayVideo( struct decoder_owner *p_owner, picture_t
>> *p_picture )
>> {
>> - struct decoder_owner *p_owner = dec_get_owner( p_dec );
>> + decoder_t *p_dec = &p_owner->dec;
>> vout_thread_t *p_vout = p_owner->p_vout;
>> bool prerolled;
>>
>> @@ -993,7 +992,7 @@ static void DecoderPlayVideo( decoder_t *p_dec,
>> picture_t *p_picture,
>> {
>> vlc_mutex_unlock( &p_owner->lock );
>> picture_Release( p_picture );
>> - return;
>> + return false;
>> }
>>
>> prerolled = p_owner->i_preroll_end > (vlc_tick_t)INT64_MIN;
>> @@ -1067,10 +1066,10 @@ static void DecoderPlayVideo( decoder_t *p_dec,
>> picture_t *p_picture,
>> goto discard;
>> }
>>
>> - return;
>> + return false;
>> discard:
>> - *pi_lost_sum += 1;
>> picture_Release( p_picture );
>> + return true;
>> }
>>
>> static void DecoderUpdateStatVideo( struct decoder_owner *p_owner,
>> @@ -1092,12 +1091,11 @@ static void DecoderUpdateStatVideo( struct
>> decoder_owner *p_owner,
>> static void DecoderQueueVideo( decoder_t *p_dec, picture_t *p_pic )
>> {
>> assert( p_pic );
>> - unsigned i_lost = 0;
>> struct decoder_owner *p_owner = dec_get_owner( p_dec );
>>
>> - DecoderPlayVideo( p_dec, p_pic, &i_lost );
>> + bool lost = DecoderPlayVideo( p_owner, p_pic );
>>
>> - p_owner->pf_update_stat( p_owner, 1, i_lost );
>> + p_owner->pf_update_stat( p_owner, 1, lost ? 1 : 0 );
>> }
>>
>> static int thumbnailer_update_format( decoder_t *p_dec )
>> --
>> 2.17.1
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
>
>
> _______________________________________________
> 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