asfdemux: Use presentation timestamp when searching in the index.
authorEdward Hervey <bilboed@bilboed.com>
Fri, 26 Jun 2009 18:44:09 +0000 (20:44 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 26 Jun 2009 18:45:09 +0000 (20:45 +0200)
We need to take the preroll into account... else we end up too early.

gst/asfdemux/gstasfdemux.c

index a9ec105..445cc24 100644 (file)
@@ -381,7 +381,7 @@ gst_asf_demux_seek_index_lookup (GstASFDemux * demux, guint * packet,
   if (demux->sidx_num_entries == 0 || demux->sidx_interval == 0)
     return FALSE;
 
-  idx = (guint) (seek_time / demux->sidx_interval);
+  idx = (guint) ((seek_time + demux->preroll) / demux->sidx_interval);
 
   /* FIXME: seek beyond end of file should result in immediate EOS from
    * streaming thread instead of a failed seek */