mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
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.
This commit is contained in:
parent
c2f54afa74
commit
ce2e82da3f
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue