Commit ce2e82da authored by Jonathan Matthew's avatar Jonathan Matthew Committed by Wim Taymans

libs/gst/base/gstbasesrc.c: Store new length in segment duration so we don't...

libs/gst/base/gstbasesrc.c: Store new length in segment duration so we don't keep on calling the potentially expensiz...

Original commit message from CVS:
Patch by: Jonathan Matthew <jonathan at kaolin dot wh9 dot net>
* libs/gst/base/gstbasesrc.c: (gst_base_src_update_length):
Store new length in segment duration so we don't keep on calling the
potentially expensize get_size() call. Fixes #370865.
parent c2f54afa
2006-11-13 Wim Taymans <wim@fluendo.com>
Patch by: Jonathan Matthew <jonathan at kaolin dot wh9 dot net>
* libs/gst/base/gstbasesrc.c: (gst_base_src_update_length):
Store new length in segment duration so we don't keep on calling the
potentially expensize get_size() call. Fixes #370865.
2006-11-10 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Sergey Scobich <sergery.scobich at gmail com>
......
......@@ -1281,7 +1281,10 @@ gst_base_src_update_length (GstBaseSrc * src, guint64 offset, guint * length)
if (G_UNLIKELY (offset + *length >= maxsize)) {
/* see if length of the file changed */
if (bclass->get_size)
bclass->get_size (src, &size);
if (!bclass->get_size (src, &size))
size = -1;
gst_segment_set_duration (&src->segment, GST_FORMAT_BYTES, size);
/* make sure we don't exceed the configured segment stop
* if it was set */
......@@ -1297,6 +1300,7 @@ gst_base_src_update_length (GstBaseSrc * src, guint64 offset, guint * length)
/* else we can clip to the end */
if (G_UNLIKELY (offset + *length >= maxsize))
*length = maxsize - offset;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment