[vlc-commits] commit: Fixed asf media length (close #2674 and close #3429). ( Laurent Aimar )

git at videolan.org git at videolan.org
Tue Mar 23 21:36:44 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Mar 23 21:29:37 2010 +0100| [3fad96bfed9cbf22c93c9f008acf27b0882c686c] | committer: Laurent Aimar 

Fixed asf media length (close #2674 and close #3429).

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

 modules/demux/asf/asf.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 570868f..e408296 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -1014,7 +1014,9 @@ static int DemuxInit( demux_t *p_demux )
         /* calculate the time duration in micro-s */
         p_sys->i_length = (mtime_t)p_sys->p_fp->i_play_duration / 10 *
                    (mtime_t)i_count /
-                   (mtime_t)p_sys->p_fp->i_data_packets_count;
+                   (mtime_t)p_sys->p_fp->i_data_packets_count - p_sys->p_fp->i_preroll * 1000;
+        if( p_sys->i_length < 0 )
+            p_sys->i_length = 0;
 
         if( p_sys->i_length > 0 )
         {



More information about the vlc-commits mailing list