+2005-11-04 Wim Taymans <wim@fluendo.com>
+
+ * gst/base/gstbasesrc.c: (gst_base_src_get_range):
+ Small update to stop at the configured segment_end
+ position.
+
2005-11-04 Stefan Kost <ensonic@users.sf.net>
* gst/gstregistry.c:
{
GstFlowReturn ret;
GstBaseSrcClass *bclass;
+ gint64 maxsize;
bclass = GST_BASE_SRC_GET_CLASS (src);
"reading offset %" G_GUINT64_FORMAT ", length %u, size %"
G_GINT64_FORMAT, offset, length, src->size);
- /* check size */
- if (src->size != -1) {
- if (offset > src->size)
- goto unexpected_length;
+ /* the max amount of bytes to read is the total size or
+ * up to the segment_end if present. */
+ if (src->segment_end != -1)
+ maxsize = MIN (src->size, src->segment_end);
+ else
+ maxsize = src->size;
- /* is segment done ? */
- if (src->segment_loop && (offset > src->segment_end))
+ /* check size */
+ if (maxsize != -1) {
+ if (offset > maxsize)
goto unexpected_length;
- if (offset + length > src->size) {
+ if (offset + length > maxsize) {
+ /* see if length of the file changed */
if (bclass->get_size)
bclass->get_size (src, &src->size);
- if (offset + length > src->size) {
- length = src->size - offset;
+ if (src->segment_end != -1)
+ maxsize = MIN (src->size, src->segment_end);
+ else
+ maxsize = src->size;
+
+ if (offset + length > maxsize) {
+ length = maxsize - offset;
}
}
}
{
GstFlowReturn ret;
GstBaseSrcClass *bclass;
+ gint64 maxsize;
bclass = GST_BASE_SRC_GET_CLASS (src);
"reading offset %" G_GUINT64_FORMAT ", length %u, size %"
G_GINT64_FORMAT, offset, length, src->size);
- /* check size */
- if (src->size != -1) {
- if (offset > src->size)
- goto unexpected_length;
+ /* the max amount of bytes to read is the total size or
+ * up to the segment_end if present. */
+ if (src->segment_end != -1)
+ maxsize = MIN (src->size, src->segment_end);
+ else
+ maxsize = src->size;
- /* is segment done ? */
- if (src->segment_loop && (offset > src->segment_end))
+ /* check size */
+ if (maxsize != -1) {
+ if (offset > maxsize)
goto unexpected_length;
- if (offset + length > src->size) {
+ if (offset + length > maxsize) {
+ /* see if length of the file changed */
if (bclass->get_size)
bclass->get_size (src, &src->size);
- if (offset + length > src->size) {
- length = src->size - offset;
+ if (src->segment_end != -1)
+ maxsize = MIN (src->size, src->segment_end);
+ else
+ maxsize = src->size;
+
+ if (offset + length > maxsize) {
+ length = maxsize - offset;
}
}
}