From b03c54d446b8bf27946b40e22d929fa03c0ea5e1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 7 Nov 2005 10:33:07 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ gst/base/gstbasesrc.c | 11 +++++++---- libs/gst/base/gstbasesrc.c | 11 +++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbd83cd8e2..00211c15ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-07 Wim Taymans + + * 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 * gst/base/gstadapter.c: diff --git a/gst/base/gstbasesrc.c b/gst/base/gstbasesrc.c index f005e1f29b..999c7c6b65 100644 --- a/gst/base/gstbasesrc.c +++ b/gst/base/gstbasesrc.c @@ -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) diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index f005e1f29b..999c7c6b65 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -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)