[vlc-devel] [PATCH 1/2] mpg123: fix sign comparison about rate

Rémi Denis-Courmont remi at remlab.net
Tue Aug 8 14:11:09 CEST 2017


Le 8 août 2017 12:20:38 GMT+03:00, Jean-Baptiste Kempf <jb at videolan.org> a écrit :
>mpg123 uses long as rate...
>---
> modules/codec/mpg123.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/modules/codec/mpg123.c b/modules/codec/mpg123.c
>index d9e646cb59..171254f707 100644
>--- a/modules/codec/mpg123.c
>+++ b/modules/codec/mpg123.c
>@@ -186,9 +186,9 @@ static int UpdateAudioFormat( decoder_t *p_dec )
>     aout_FormatPrepare( &p_dec->fmt_out.audio );
> 
>     /* Date management */
>-    if( p_dec->fmt_out.audio.i_rate != frame_info.rate )
>+    if( p_dec->fmt_out.audio.i_rate != (unsigned int)frame_info.rate )
>     {
>-        p_dec->fmt_out.audio.i_rate = frame_info.rate;
>+        p_dec->fmt_out.audio.i_rate = (unsigned int)frame_info.rate;
>         date_Init( &p_sys->end_date, p_dec->fmt_out.audio.i_rate, 1 );
>         date_Set( &p_sys->end_date, 0 );
>     }
>-- 
>2.13.3
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

This won't work if the rate can be larger than UINT_MAX. I don't know the mpg123 internals.
-- 
Rémi Denis-Courmont
Typed on an inconvenient virtual keyboard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170808/e8e48278/attachment.html>


More information about the vlc-devel mailing list