[vlc-commits] demux: asf: set preroll point after indexless seek

Francois Cartegnie git at videolan.org
Fri May 16 21:06:33 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri May 16 13:58:42 2014 +0200| [3e90cf530ece5b6a6996ccc22f29f0fb55443006] | committer: Francois Cartegnie

demux: asf: set preroll point after indexless seek

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

 modules/demux/asf/asf.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 9e63a44..df7735e 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -73,6 +73,7 @@ static int Control( demux_t *, int i_query, va_list args );
 static void FlushRemainingPackets( demux_t *p_demux );
 
 #define MAX_ASF_TRACKS 128
+#define ASF_PREROLL_FROM_CURRENT -1
 
 typedef struct
 {
@@ -363,6 +364,7 @@ static void SeekPrepare( demux_t *p_demux )
     demux_sys_t *p_sys = p_demux->p_sys;
 
     p_sys->i_time = VLC_TS_INVALID;
+    p_sys->i_preroll_start = ASF_PREROLL_FROM_CURRENT;
     for( int i = 0; i < MAX_ASF_TRACKS ; i++ )
     {
         asf_track_t *tk = p_sys->track[i];
@@ -761,6 +763,10 @@ static int DemuxPayload(demux_t *p_demux, struct asf_packet_t *pkt, int i_payloa
     uint32_t i_temp_payload_length = 0;
     p_sys->p_fp->i_preroll = __MIN( p_sys->p_fp->i_preroll, INT64_MAX );
 
+    /* First packet, in case we do not have index to guess preroll start time */
+    if ( p_sys->i_preroll_start == ASF_PREROLL_FROM_CURRENT )
+        p_sys->i_preroll_start = pkt->send_time * 1000;
+
     /* Non compressed */
     if( i_replicated_data_length > 7 ) // should be at least 8 bytes
     {



More information about the vlc-commits mailing list