mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
plugins/elements/gsttypefindelement.c: We can do peeks at non-zero offsets, as long as they fall within the buffer we...
Original commit message from CVS: * plugins/elements/gsttypefindelement.c: (find_peek): We can do peeks at non-zero offsets, as long as they fall within the buffer we have.
This commit is contained in:
parent
1d6170b811
commit
a225c1ed41
2 changed files with 21 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-02-15 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* plugins/elements/gsttypefindelement.c: (find_peek):
|
||||||
|
We can do peeks at non-zero offsets, as long as they
|
||||||
|
fall within the buffer we have.
|
||||||
|
|
||||||
2006-02-15 Jan Schmidt <thaytan@mad.scientist.com>
|
2006-02-15 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
* tests/check/Makefile.am:
|
* tests/check/Makefile.am:
|
||||||
|
|
|
@ -607,8 +607,22 @@ find_peek (gpointer data, gint64 offset, guint size)
|
||||||
|
|
||||||
GST_LOG_OBJECT (entry->self, "'%s' called peek (%" G_GINT64_FORMAT ", %u)",
|
GST_LOG_OBJECT (entry->self, "'%s' called peek (%" G_GINT64_FORMAT ", %u)",
|
||||||
GST_PLUGIN_FEATURE_NAME (entry->factory), offset, size);
|
GST_PLUGIN_FEATURE_NAME (entry->factory), offset, size);
|
||||||
if (offset != 0)
|
|
||||||
|
if (offset < 0) {
|
||||||
|
GST_LOG_OBJECT (entry->self, "peek at end not supported in push mode");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (offset > 0) {
|
||||||
|
if ((offset + size) <= entry->self->store->size) {
|
||||||
|
entry->requested_size = 0;
|
||||||
|
return GST_BUFFER_DATA (entry->self->store) + offset;
|
||||||
|
}
|
||||||
|
/* no can do */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* offset == 0 ... */
|
||||||
|
|
||||||
if (size <= entry->self->store->size) {
|
if (size <= entry->self->store->size) {
|
||||||
entry->requested_size = 0;
|
entry->requested_size = 0;
|
||||||
|
|
Loading…
Reference in a new issue