[vlc-devel] problem with avi file

Michael Pron michael.pron at noos.fr
Tue Jun 1 15:36:59 CEST 2004


I think there's a problem in the avi demuxer.
when we use input_Seek, we can't move in the file using the
INPUT_SEEK_SECONDS case. The typical example came when we tried to use
the "go to..."(in French "Sauter à..." ) option of the contextual menu of the gtk interface.
When using it, we simply go to the beginning of the file, in all cases.
So i discover that there was'nt any computation of the demuxer rate in
modules/demux/avi.c witch result in a zero value of
p_input->stream.i_mux_rate in src/input/input_ext-intf.c.

Looking at what was done in the past versions I propose a patch that
solve the problem.

michael
-------------- next part --------------
Index: modules/demux/avi/avi.c
===================================================================
RCS file: /var/cvs/videolan/vlc/modules/demux/avi/avi.c,v
retrieving revision 1.99
diff -u -r1.99 avi.c
--- modules/demux/avi/avi.c	15 May 2004 10:58:24 -0000	1.99
+++ modules/demux/avi/avi.c	1 Jun 2004 13:16:27 -0000
@@ -194,6 +194,8 @@
     demux_t  *p_demux = (demux_t *)p_this;
     demux_sys_t     *p_sys;
 
+    input_thread_t *p_input;
+
     avi_chunk_t         ck_riff;
     avi_chunk_list_t    *p_riff = (avi_chunk_list_t*)&ck_riff;
     avi_chunk_list_t    *p_hdrl, *p_movi;
@@ -508,6 +510,17 @@
             msg_Warn( p_demux, "track[%d] fixed with rate=%d scale=%d (BeOS MediaKit generated)", i, tk->i_rate, tk->i_scale );
         }
     }
+
+
+    if( p_sys->i_length )
+    {
+	    vlc_mutex_lock( &p_input->stream.stream_lock );
+	    p_input->stream.i_mux_rate = stream_Size( p_demux->s ) / 50 / p_sys->i_length;
+	    vlc_cond_signal( &p_input->stream.stream_wait );
+	    vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+    }
+    vlc_object_release( p_input );
 
     if( p_sys->b_seekable )
     {


More information about the vlc-devel mailing list