diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2015-07-17 17:43:26 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2015-07-17 17:44:44 -0400 |
commit | 8b6e8701d5fb90559e517b0d03fdce12c50c7c5b (patch) | |
tree | 0d6123a66150c31e465a25f126dc45a1c9395e50 | |
parent | eedd9cb7b7ecb50f538f70cd1269ca767bf62140 (diff) |
baseparse: Fix extrapolation of seeksegment.stop
The stop shall be relative to start if extrapolated from the
duration.
https://bugzilla.gnome.org/show_bug.cgi?id=750783
-rw-r--r-- | libs/gst/base/gstbaseparse.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 19e0ada7d..146e35ed0 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -4334,8 +4334,9 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) else startpos -= parse->priv->lead_in_ts; - if (seeksegment.stop == -1) - seeksegment.stop = seeksegment.duration; + if (seeksegment.stop == -1 && seeksegment.duration != -1) + seeksegment.stop = seeksegment.start + seeksegment.duration; + seekpos = gst_base_parse_find_offset (parse, startpos, TRUE, &start_ts); seekstop = gst_base_parse_find_offset (parse, seeksegment.stop, FALSE, NULL); @@ -4346,8 +4347,9 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) else start_ts = start; - if (seeksegment.stop == -1) - seeksegment.stop = seeksegment.duration; + if (seeksegment.stop == -1 && seeksegment.duration != -1) + seeksegment.stop = seeksegment.start + seeksegment.duration; + if (!gst_base_parse_convert (parse, format, start_ts, GST_FORMAT_BYTES, &seekpos)) goto convert_failed; |