mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
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:
parent
acb67fee6e
commit
e8c5627802
1 changed files with 5 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue