mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
basesrc: in automatic_eos mode, don't modify the size
Don't set the size to -1 in automatic_eos mode (which also updates the duration to -1). We only want automatic_eos mode influence the maxsize calculations without any side effects. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=724564
This commit is contained in:
parent
a2742a575b
commit
04a6c661c8
1 changed files with 9 additions and 7 deletions
|
@ -2321,16 +2321,18 @@ gst_base_src_update_length (GstBaseSrc * src, guint64 offset, guint * length,
|
||||||
stop = src->segment.stop;
|
stop = src->segment.stop;
|
||||||
/* get total file size */
|
/* get total file size */
|
||||||
size = src->segment.duration;
|
size = src->segment.duration;
|
||||||
if (!g_atomic_int_get (&src->priv->automatic_eos))
|
|
||||||
size = -1;
|
|
||||||
|
|
||||||
/* only operate if we are working with bytes */
|
/* only operate if we are working with bytes */
|
||||||
if (format != GST_FORMAT_BYTES)
|
if (format != GST_FORMAT_BYTES)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* the max amount of bytes to read is the total size or
|
/* when not doing automatic EOS, just use the stop position. We don't use
|
||||||
* up to the segment.stop if present. */
|
* the size to check for EOS */
|
||||||
if (stop != -1)
|
if (!g_atomic_int_get (&src->priv->automatic_eos))
|
||||||
|
maxsize = stop;
|
||||||
|
/* Otherwise, the max amount of bytes to read is the total
|
||||||
|
* size or up to the segment.stop if present. */
|
||||||
|
else if (stop != -1)
|
||||||
maxsize = size != -1 ? MIN (size, stop) : stop;
|
maxsize = size != -1 ? MIN (size, stop) : stop;
|
||||||
else
|
else
|
||||||
maxsize = size;
|
maxsize = size;
|
||||||
|
@ -2368,8 +2370,8 @@ gst_base_src_update_length (GstBaseSrc * src, guint64 offset, guint * length,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* keep track of current duration.
|
/* keep track of current duration. segment is in bytes, we checked
|
||||||
* segment is in bytes, we checked that above. */
|
* that above. */
|
||||||
GST_OBJECT_LOCK (src);
|
GST_OBJECT_LOCK (src);
|
||||||
src->segment.duration = size;
|
src->segment.duration = size;
|
||||||
GST_OBJECT_UNLOCK (src);
|
GST_OBJECT_UNLOCK (src);
|
||||||
|
|
Loading…
Reference in a new issue