[gst-cvs] gst-plugins-bad: mpegpsdemux: in seeking use a factor for SCR interpolation

Josep Torra adn770 at kemper.freedesktop.org
Fri Sep 4 03:56:23 PDT 2009


Module: gst-plugins-bad
Branch: master
Commit: 7fa795a725cb15859b19e4fd8e1529d902c2a0e2
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=7fa795a725cb15859b19e4fd8e1529d902c2a0e2

Author: Josep Torra <n770galaxy at gmail.com>
Date:   Fri Sep  4 12:53:36 2009 +0200

mpegpsdemux: in seeking use a factor for SCR interpolation

Fixes seeking on clips where PTS are unalignded with SCR.

---

 gst/mpegdemux/gstmpegdemux.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c
index 5fe2771..e4be205 100644
--- a/gst/mpegdemux/gstmpegdemux.c
+++ b/gst/mpegdemux/gstmpegdemux.c
@@ -1037,6 +1037,12 @@ gst_flups_demux_do_seek (GstFluPSDemux * demux, GstSegment * seeksegment)
   guint64 scr_rate_n = demux->last_scr_offset - demux->first_scr_offset;
   guint64 scr_rate_d = demux->last_scr - demux->first_scr;
 
+  /* In some clips the PTS values are completely unaligned with SCR values.
+   * To improve the seek in that situation we apply a factor considering the
+   * relationship between last PTS and last SCR */
+  if (demux->last_scr > demux->last_pts)
+    scr = gst_util_uint64_scale (scr, demux->last_scr, demux->last_pts);
+
   scr = MIN (demux->last_scr, scr);
   scr = MAX (demux->first_scr, scr);
   fscr = scr;





More information about the Gstreamer-commits mailing list