summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/cache.c4
-rw-r--r--libavformat/nut.c12
-rw-r--r--libavformat/nut.h4
-rw-r--r--libavformat/nutdec.c6
-rw-r--r--libavformat/nutenc.c2
5 files changed, 15 insertions, 13 deletions
diff --git a/libavformat/cache.c b/libavformat/cache.c
index d3d12bb4d5..a762aa9ca5 100644
--- a/libavformat/cache.c
+++ b/libavformat/cache.c
@@ -65,9 +65,9 @@ typedef struct Context {
int read_ahead_limit;
} Context;
-static int cmp(void *key, const void *node)
+static int cmp(const void *key, const void *node)
{
- return (*(int64_t *) key) - ((const CacheEntry *) node)->logical_pos;
+ return (*(const int64_t *) key) - ((const CacheEntry *) node)->logical_pos;
}
static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **options)
diff --git a/libavformat/nut.c b/libavformat/nut.c
index c6fdb0bff8..41e51df837 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -237,14 +237,16 @@ int64_t ff_lsb2full(StreamContext *stream, int64_t lsb)
return ((lsb - delta) & mask) + delta;
}
-int ff_nut_sp_pos_cmp(const Syncpoint *a, const Syncpoint *b)
+int ff_nut_sp_pos_cmp(const void *a, const void *b)
{
- return ((a->pos - b->pos) >> 32) - ((b->pos - a->pos) >> 32);
+ const Syncpoint *va = a, *vb = b;
+ return ((va->pos - vb->pos) >> 32) - ((vb->pos - va->pos) >> 32);
}
-int ff_nut_sp_pts_cmp(const Syncpoint *a, const Syncpoint *b)
+int ff_nut_sp_pts_cmp(const void *a, const void *b)
{
- return ((a->ts - b->ts) >> 32) - ((b->ts - a->ts) >> 32);
+ const Syncpoint *va = a, *vb = b;
+ return ((va->ts - vb->ts) >> 32) - ((vb->ts - va->ts) >> 32);
}
int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts)
@@ -263,7 +265,7 @@ int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts)
sp->pos = pos;
sp->back_ptr = back_ptr;
sp->ts = ts;
- av_tree_insert(&nut->syncpoints, sp, (void *) ff_nut_sp_pos_cmp, &node);
+ av_tree_insert(&nut->syncpoints, sp, ff_nut_sp_pos_cmp, &node);
if (node) {
av_free(sp);
av_free(node);
diff --git a/libavformat/nut.h b/libavformat/nut.h
index 45aa55cd4d..a4409ee23d 100644
--- a/libavformat/nut.h
+++ b/libavformat/nut.h
@@ -132,8 +132,8 @@ typedef struct Dispositions {
void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val);
int64_t ff_lsb2full(StreamContext *stream, int64_t lsb);
-int ff_nut_sp_pos_cmp(const Syncpoint *a, const Syncpoint *b);
-int ff_nut_sp_pts_cmp(const Syncpoint *a, const Syncpoint *b);
+int ff_nut_sp_pos_cmp(const void *a, const void *b);
+int ff_nut_sp_pts_cmp(const void *a, const void *b);
int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts);
void ff_nut_free_sp(NUTContext *nut);
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 63b0cd2fb9..deceb032e5 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -1271,7 +1271,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
pos2 = st->index_entries[index].pos;
ts = st->index_entries[index].timestamp;
} else {
- av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pts_cmp,
+ av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pts_cmp,
(void **) next_node);
av_log(s, AV_LOG_DEBUG, "%"PRIu64"-%"PRIu64" %"PRId64"-%"PRId64"\n",
next_node[0]->pos, next_node[1]->pos, next_node[0]->ts,
@@ -1286,7 +1286,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
if (!(flags & AVSEEK_FLAG_BACKWARD)) {
dummy.pos = pos + 16;
next_node[1] = &nopts_sp;
- av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp,
+ av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pos_cmp,
(void **) next_node);
pos2 = ff_gen_search(s, -2, dummy.pos, next_node[0]->pos,
next_node[1]->pos, next_node[1]->pos,
@@ -1297,7 +1297,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
// FIXME dir but I think it does not matter
}
dummy.pos = pos;
- sp = av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp,
+ sp = av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pos_cmp,
NULL);
av_assert0(sp);
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 49d62bfbec..cad31f80fb 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -587,7 +587,7 @@ static int write_index(NUTContext *nut, AVIOContext *bc) {
ff_put_v(bc, nut->sp_count);
for (i=0; i<nut->sp_count; i++) {
- av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp, (void**)next_node);
+ av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pos_cmp, (void**)next_node);
ff_put_v(bc, (next_node[1]->pos >> 4) - (dummy.pos>>4));
dummy.pos = next_node[1]->pos;
}