]> git.sesse.net Git - vlc/commitdiff
Fixed initial timestamp value in CDG demuxer.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 20 Dec 2009 15:46:05 +0000 (16:46 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 20 Dec 2009 22:23:27 +0000 (23:23 +0100)
CDG demuxer is VLC_TS_INVALID compliant.

modules/demux/cdg.c

index 4b6e59d4400afa1613f1174ad79c8270eae4a832..6cc401fc5737bef64d3b4ebb29e5853a4c7a8b63 100644 (file)
@@ -102,7 +102,7 @@ static int Open( vlc_object_t * p_this )
 
     /* There is CDG_FRAME_RATE frames per second */
     date_Init( &p_sys->pts, CDG_FRAME_RATE, 1 );
-    date_Set( &p_sys->pts, 1 );
+    date_Set( &p_sys->pts, 0 );
 
     return VLC_SUCCESS;
 }
@@ -125,11 +125,14 @@ static int Demux( demux_t *p_demux )
     }
 
     p_block->i_dts =
-    p_block->i_pts = date_Increment( &p_sys->pts, 1 );
+    p_block->i_pts = VLC_TS_0 + date_Get( &p_sys->pts );
 
     es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block->i_pts );
 
     es_out_Send( p_demux->out, p_sys->p_es, p_block );
+
+    date_Increment( &p_sys->pts, 1 );
+
     return 1;
 }