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:
Tim-Philipp Müller 2006-02-15 12:17:50 +00:00
parent 1d6170b811
commit a225c1ed41
2 changed files with 21 additions and 1 deletions

View file

@ -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>
* tests/check/Makefile.am:

View file

@ -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_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;
}
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) {
entry->requested_size = 0;