gst/base/gstbasesrc.c: Set the segment_end to -1 initially. Fixed typefind.

Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_get_range):
Set the segment_end to -1 initially. Fixed typefind.
This commit is contained in:
Wim Taymans 2005-11-07 10:33:07 +00:00
parent 9fa579c299
commit b03c54d446
3 changed files with 20 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2005-11-07 Wim Taymans <wim@fluendo.com>
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_get_range):
Set the segment_end to -1 initially. Fixed typefind.
2005-11-07 Tim-Philipp Müller <tim at centricular dot net>
* gst/base/gstadapter.c:

View file

@ -218,6 +218,8 @@ gst_base_src_init (GstBaseSrc * basesrc, gpointer g_class)
basesrc->blocksize = DEFAULT_BLOCKSIZE;
basesrc->clock_id = NULL;
basesrc->segment_start = 0;
basesrc->segment_end = -1;
GST_OBJECT_FLAG_UNSET (basesrc, GST_BASE_SRC_STARTED);
@ -813,10 +815,6 @@ gst_base_src_get_range (GstBaseSrc * src, guint64 offset, guint length,
if (G_UNLIKELY (!bclass->create))
goto no_function;
GST_DEBUG_OBJECT (src,
"reading offset %" G_GUINT64_FORMAT ", length %u, size %"
G_GINT64_FORMAT, offset, length, src->size);
/* the max amount of bytes to read is the total size or
* up to the segment_end if present. */
if (src->segment_end != -1)
@ -824,6 +822,11 @@ gst_base_src_get_range (GstBaseSrc * src, guint64 offset, guint length,
else
maxsize = src->size;
GST_DEBUG_OBJECT (src,
"reading offset %" G_GUINT64_FORMAT ", length %u, size %" G_GINT64_FORMAT
", segment_end %" G_GINT64_FORMAT ", maxsize %" G_GINT64_FORMAT, offset,
length, src->size, src->segment_end, maxsize);
/* check size */
if (maxsize != -1) {
if (offset > maxsize)

View file

@ -218,6 +218,8 @@ gst_base_src_init (GstBaseSrc * basesrc, gpointer g_class)
basesrc->blocksize = DEFAULT_BLOCKSIZE;
basesrc->clock_id = NULL;
basesrc->segment_start = 0;
basesrc->segment_end = -1;
GST_OBJECT_FLAG_UNSET (basesrc, GST_BASE_SRC_STARTED);
@ -813,10 +815,6 @@ gst_base_src_get_range (GstBaseSrc * src, guint64 offset, guint length,
if (G_UNLIKELY (!bclass->create))
goto no_function;
GST_DEBUG_OBJECT (src,
"reading offset %" G_GUINT64_FORMAT ", length %u, size %"
G_GINT64_FORMAT, offset, length, src->size);
/* the max amount of bytes to read is the total size or
* up to the segment_end if present. */
if (src->segment_end != -1)
@ -824,6 +822,11 @@ gst_base_src_get_range (GstBaseSrc * src, guint64 offset, guint length,
else
maxsize = src->size;
GST_DEBUG_OBJECT (src,
"reading offset %" G_GUINT64_FORMAT ", length %u, size %" G_GINT64_FORMAT
", segment_end %" G_GINT64_FORMAT ", maxsize %" G_GINT64_FORMAT, offset,
length, src->size, src->segment_end, maxsize);
/* check size */
if (maxsize != -1) {
if (offset > maxsize)