diff options
author | Jonathan Matthew <jonathan@kaolin.wh9.net> | 2006-11-13 17:54:58 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2006-11-13 17:54:58 +0000 |
commit | ce2e82da3f8ae418285ac8c58be352a971d054cc (patch) | |
tree | 91dd8607584c0ed41c76012c5b2b41814109f3b0 /libs | |
parent | c2f54afa7407f9495e09d638af8372b3f9a9ad99 (diff) |
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.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gst/base/gstbasesrc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 8e464473a..a60c07eeb 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -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; + } } |