tests: icles: fix build

Can't do additions/subtractions on void* pointers.
This commit is contained in:
Tim-Philipp Müller 2017-07-21 19:01:19 +01:00
parent b028d91439
commit 81e5b0bdee

View file

@ -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);