[vlc-commits] demux: avi: change broken rate test

Francois Cartegnie git at videolan.org
Wed Aug 22 17:56:21 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jul 20 17:33:17 2018 +0200| [3d32959f4a6f15398a9fe54090a0cdf9850dc90a] | committer: Francois Cartegnie

demux: avi: change broken rate test

Solves regression with rates < 1
Unsure what the original check was fixing.
refs #1162

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

 modules/demux/avi/avi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index da79217528..39c980e7ea 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -462,7 +462,7 @@ static int Open( vlc_object_t * p_this )
         tk->i_samplesize = p_strh->i_samplesize;
         msg_Dbg( p_demux, "stream[%u] rate:%u scale:%u samplesize:%u",
                 i, tk->i_rate, tk->i_scale, tk->i_samplesize );
-        if( tk->i_scale > tk->i_rate || !tk->i_scale || !tk->i_rate )
+        if( !tk->i_scale || !tk->i_rate || !(tk->i_rate * CLOCK_FREQ / tk->i_scale) )
         {
             free( tk );
             continue;



More information about the vlc-commits mailing list