mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
tests: icles: fix build
Can't do additions/subtractions on void* pointers.
This commit is contained in:
parent
b028d91439
commit
81e5b0bdee
1 changed files with 7 additions and 5 deletions
|
@ -31,12 +31,12 @@
|
||||||
|
|
||||||
#define SAMPLE_FREQ 44100
|
#define SAMPLE_FREQ 44100
|
||||||
|
|
||||||
void *
|
static const guint8 *
|
||||||
_memmem (const void *haystack, size_t hlen, const void *needle, size_t nlen)
|
_memmem (const guint8 * haystack, gsize hlen, const guint8 * needle, gsize nlen)
|
||||||
{
|
{
|
||||||
|
const guint8 *p = haystack;
|
||||||
int needle_first;
|
int needle_first;
|
||||||
const void *p = haystack;
|
gsize plen = hlen;
|
||||||
size_t plen = hlen;
|
|
||||||
|
|
||||||
if (!nlen)
|
if (!nlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -45,7 +45,7 @@ _memmem (const void *haystack, size_t hlen, const void *needle, size_t nlen)
|
||||||
|
|
||||||
while (plen >= nlen && (p = memchr (p, needle_first, plen - nlen + 1))) {
|
while (plen >= nlen && (p = memchr (p, needle_first, plen - nlen + 1))) {
|
||||||
if (!memcmp (p, needle, nlen))
|
if (!memcmp (p, needle, nlen))
|
||||||
return (void *) p;
|
return (guint8 *) p;
|
||||||
|
|
||||||
p++;
|
p++;
|
||||||
plen = hlen - (p - haystack);
|
plen = hlen - (p - haystack);
|
||||||
|
@ -231,6 +231,8 @@ test_seek_FORMAT_TIME_by_sample (const gchar * fn, GList * seek_positions)
|
||||||
|
|
||||||
buf = gst_sample_get_buffer (sample);
|
buf = gst_sample_get_buffer (sample);
|
||||||
gst_buffer_map (buf, &map, GST_MAP_READ);
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
||||||
|
GST_MEMDUMP ("answer", answer, answer_size);
|
||||||
|
GST_MEMDUMP ("buffer", map.data, map.size);
|
||||||
found = _memmem (answer, answer_size, map.data, map.size);
|
found = _memmem (answer, answer_size, map.data, map.size);
|
||||||
gst_buffer_unmap (buf, &map);
|
gst_buffer_unmap (buf, &map);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue