[vlc-devel] commit: Fixed initial timestamp value in MOD demuxer. (Laurent Aimar )

git version control git at videolan.org
Mon Dec 21 00:02:32 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Dec 20 21:01:14 2009 +0100| [bba4e5fad969aa19ba1f29c9b5299896088026ca] | committer: Laurent Aimar 

Fixed initial timestamp value in MOD demuxer.

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

 modules/demux/mod.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mod.c b/modules/demux/mod.c
index f3f162c..37deaa4 100644
--- a/modules/demux/mod.c
+++ b/modules/demux/mod.c
@@ -235,7 +235,7 @@ static int Open( vlc_object_t *p_this )
 
     /* init time */
     date_Init( &p_sys->pts, settings.mFrequency, 1 );
-    date_Set( &p_sys->pts, 1 );
+    date_Set( &p_sys->pts, 0 );
     p_sys->i_length = ModPlug_GetLength( p_sys->f ) * INT64_C(1000);
 
     msg_Dbg( p_demux, "MOD loaded name=%s lenght=%"PRId64"ms",
@@ -292,7 +292,7 @@ static int Demux( demux_t *p_demux )
     }
     p_frame->i_buffer = i_read;
     p_frame->i_dts =
-    p_frame->i_pts = date_Increment( &p_sys->pts, p_frame->i_buffer / i_bk );
+    p_frame->i_pts = VLC_TS_0 + date_Get( &p_sys->pts );
 
     /* Set PCR */
     es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_frame->i_pts );
@@ -300,6 +300,8 @@ static int Demux( demux_t *p_demux )
     /* Send data */
     es_out_Send( p_demux->out, p_sys->es, p_frame );
 
+    date_Increment( &p_sys->pts, i_read / i_bk );
+
     return 1;
 }
 
@@ -332,7 +334,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         if( i64 >= 0 && i64 <= p_sys->i_length )
         {
             ModPlug_Seek( p_sys->f, i64 / 1000 );
-            date_Set( &p_sys->pts, i64 + 1 );
+            date_Set( &p_sys->pts, i64 );
 
             return VLC_SUCCESS;
         }
@@ -354,7 +356,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         if( i64 >= 0 && i64 <= p_sys->i_length )
         {
             ModPlug_Seek( p_sys->f, i64 / 1000 );
-            date_Set( &p_sys->pts, i64 + 1 );
+            date_Set( &p_sys->pts, i64 );
 
             return VLC_SUCCESS;
         }




More information about the vlc-devel mailing list