[vlc-devel] commit: Fixed invalid report of broken avi index. (Laurent Aimar )
git version control
git at videolan.org
Sat Oct 3 18:42:18 CEST 2009
vlc | branch: 1.0-bugfix | Laurent Aimar <fenrir at videolan.org> | Tue Sep 29 21:04:13 2009 +0200| [e04c3e1aef7b40022a5731d3020abc29a151fa4d] | committer: Laurent Aimar
Fixed invalid report of broken avi index.
AVI demuxer now also check the number of frames from the index and the
avi header.
Thanks MSJ for the report on the forum.
(cherry picked from commit a2671feb378ec308e42a0e50ce9bfc41262baf9c)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e04c3e1aef7b40022a5731d3020abc29a151fa4d
---
modules/demux/avi/avi.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 4fe88b4..47a97e4 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -672,7 +672,18 @@ aviindex:
/* *** movie length in sec *** */
p_sys->i_length = AVI_MovieGetLength( p_demux );
- if( p_sys->i_length < (mtime_t)p_avih->i_totalframes *
+
+ /* Check the index completeness */
+ unsigned int i_idx_totalframes = 0;
+ for( unsigned int i = 0; i < p_sys->i_track; i++ )
+ {
+ const avi_track_t *tk = p_sys->track[i];
+ if( tk->i_cat == VIDEO_ES && tk->p_index )
+ i_idx_totalframes = __MAX(i_idx_totalframes, tk->i_idxnb);
+ continue;
+ }
+ if( i_idx_totalframes != p_avih->i_totalframes &&
+ p_sys->i_length < (mtime_t)p_avih->i_totalframes *
(mtime_t)p_avih->i_microsecperframe /
(mtime_t)1000000 )
{
More information about the vlc-devel
mailing list