From dc096f39d1b403fc1d144a1762e86b94be8bbc78 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 4 Aug 2011 17:12:47 +0200 Subject: [PATCH] basesrc: cleanups and mark reconfigure Don't abuse the result variable. Mark the srcpad with a reconfigure so that negotiation happens. --- libs/gst/base/gstbasesrc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 153aabf..c716fb0 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -2844,7 +2844,7 @@ static gboolean gst_base_src_start (GstBaseSrc * basesrc) { GstBaseSrcClass *bclass; - gboolean result; + gboolean result, have_size; guint64 size; gboolean seekable; GstFormat format; @@ -2877,13 +2877,12 @@ gst_base_src_start (GstBaseSrc * basesrc) format = basesrc->segment.format; /* figure out the size */ + have_size = FALSE; + size = -1; if (format == GST_FORMAT_BYTES) { if (bclass->get_size) { - if (!(result = bclass->get_size (basesrc, &size))) + if (!(have_size = bclass->get_size (basesrc, &size))) size = -1; - } else { - result = FALSE; - size = -1; } GST_DEBUG_OBJECT (basesrc, "setting size %" G_GUINT64_FORMAT, size); /* only update the size when operating in bytes, subclass is supposed @@ -2891,13 +2890,11 @@ gst_base_src_start (GstBaseSrc * basesrc) GST_OBJECT_LOCK (basesrc); basesrc->segment.duration = size; GST_OBJECT_UNLOCK (basesrc); - } else { - size = -1; } GST_DEBUG_OBJECT (basesrc, "format: %s, have size: %d, size: %" G_GUINT64_FORMAT ", duration: %" - G_GINT64_FORMAT, gst_format_get_name (format), result, size, + G_GINT64_FORMAT, gst_format_get_name (format), have_size, size, basesrc->segment.duration); seekable = gst_base_src_seekable (basesrc); @@ -2908,7 +2905,9 @@ gst_base_src_start (GstBaseSrc * basesrc) GST_DEBUG_OBJECT (basesrc, "is random_access: %d", basesrc->random_access); - return result; + gst_pad_mark_reconfigure (GST_BASE_SRC_PAD (basesrc)); + + return TRUE; /* ERROR */ could_not_start: -- 2.7.4