mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
mpegpsdemux: take into account SCR offset when seeking
Since the seeking byte offset is chosen by linear interpolation from SCR values, we need to take that first SCR into account to end up near the correct offset. Otherwise, as the code does a linear search after that first seek, it will take a LOOOOOONG time to get there for streams which don't start at zero. https://bugzilla.gnome.org/show_bug.cgi?id=659485
This commit is contained in:
parent
49d1121101
commit
46dd7941f3
1 changed files with 3 additions and 2 deletions
|
@ -1042,8 +1042,9 @@ gst_flups_demux_do_seek (GstFluPSDemux * demux, GstSegment * seeksegment)
|
|||
GST_INFO_OBJECT (demux, "sink segment configured %" GST_SEGMENT_FORMAT
|
||||
", trying to go at SCR: %" G_GUINT64_FORMAT, &demux->sink_segment, scr);
|
||||
|
||||
offset = MIN (gst_util_uint64_scale (scr, scr_rate_n, scr_rate_d),
|
||||
demux->sink_segment.stop);
|
||||
offset =
|
||||
MIN (gst_util_uint64_scale (scr - demux->first_scr, scr_rate_n,
|
||||
scr_rate_d), demux->sink_segment.stop);
|
||||
|
||||
found = gst_flups_demux_scan_forward_ts (demux, &offset, SCAN_SCR, &fscr);
|
||||
if (!found) {
|
||||
|
|
Loading…
Reference in a new issue