basesrc: move the quick return up

Don't assign local vars if we skip anyway. Add logging for failure conditio
This commit is contained in:
Stefan Sauer 2014-09-25 20:23:31 +02:00
parent acb67fee6e
commit e8c5627802

View file

@ -2310,20 +2310,18 @@ gst_base_src_update_length (GstBaseSrc * src, guint64 offset, guint * length,
{
guint64 size, maxsize;
GstBaseSrcClass *bclass;
GstFormat format;
gint64 stop;
/* only operate if we are working with bytes */
if (src->segment.format != GST_FORMAT_BYTES)
return TRUE;
bclass = GST_BASE_SRC_GET_CLASS (src);
format = src->segment.format;
stop = src->segment.stop;
/* get total file size */
size = src->segment.duration;
/* only operate if we are working with bytes */
if (format != GST_FORMAT_BYTES)
return TRUE;
/* when not doing automatic EOS, just use the stop position. We don't use
* the size to check for EOS */
if (!g_atomic_int_get (&src->priv->automatic_eos))
@ -2379,6 +2377,7 @@ gst_base_src_update_length (GstBaseSrc * src, guint64 offset, guint * length,
/* ERRORS */
unexpected_length:
{
GST_WARNING_OBJECT (src, "processing at or past EOS");
return FALSE;
}
}