# HG changeset patch # User vitor # Date 1269770398 0 # Node ID dbbcecb1a0ddb56ceffc71e21d6118983da059d3 # Parent 7028f9476da4f81a7d9abbaa60c06290f36f07f9 Fix NUT (de)muxer warnings: CC libavformat/nutdec.o libavformat/nutdec.c: In function ¡Æread_seek¡Ç: libavformat/nutdec.c:862: warning: passing argument 3 of ¡Æav_tree_find¡Ç from incompatible pointer type ./libavutil/tree.h:44: note: expected ¡Æint (*)(void *, const void *)¡Ç but argument is of type ¡Æint (*)(struct Syncpoint *, struct Syncpoint *)¡Ç libavformat/nutdec.c:871: warning: passing argument 3 of ¡Æav_tree_find¡Ç from incompatible pointer type ./libavutil/tree.h:44: note: expected ¡Æint (*)(void *, const void *)¡Ç but argument is of type ¡Æint (*)(struct Syncpoint *, struct Syncpoint *)¡Ç libavformat/nutdec.c:879: warning: passing argument 3 of ¡Æav_tree_find¡Ç from incompatible pointer type ./libavutil/tree.h:44: note: expected ¡Æint (*)(void *, const void *)¡Ç but argument is of type ¡Æint (*)(struct Syncpoint *, struct Syncpoint *)¡Ç CC libavformat/nutenc.o libavformat/nutenc.c: In function ¡Æwrite_packet¡Ç: libavformat/nutenc.c:680: warning: passing argument 3 of ¡Æav_tree_find¡Ç from incompatible pointer type ./libavutil/tree.h:44: note: expected ¡Æint (*)(void *, const void *)¡Ç but argument is of type ¡Æint (*)(struct Syncpoint *, struct Syncpoint *)¡Ç diff -r 7028f9476da4 -r dbbcecb1a0dd nut.c --- a/nut.c Sun Mar 28 08:48:45 2010 +0000 +++ b/nut.c Sun Mar 28 09:59:58 2010 +0000 @@ -47,11 +47,11 @@ return ((lsb - delta)&mask) + delta; } -int ff_nut_sp_pos_cmp(Syncpoint *a, Syncpoint *b){ +int ff_nut_sp_pos_cmp(const Syncpoint *a, const Syncpoint *b){ return ((a->pos - b->pos) >> 32) - ((b->pos - a->pos) >> 32); } -int ff_nut_sp_pts_cmp(Syncpoint *a, Syncpoint *b){ +int ff_nut_sp_pts_cmp(const Syncpoint *a, const Syncpoint *b){ return ((a->ts - b->ts) >> 32) - ((b->ts - a->ts) >> 32); } @@ -62,7 +62,7 @@ sp->pos= pos; sp->back_ptr= back_ptr; sp->ts= ts; - av_tree_insert(&nut->syncpoints, sp, ff_nut_sp_pos_cmp, &node); + av_tree_insert(&nut->syncpoints, sp, (void *) ff_nut_sp_pos_cmp, &node); if(node){ av_free(sp); av_free(node); diff -r 7028f9476da4 -r dbbcecb1a0dd nut.h --- a/nut.h Sun Mar 28 08:48:45 2010 +0000 +++ b/nut.h Sun Mar 28 09:59:58 2010 +0000 @@ -107,8 +107,8 @@ 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(Syncpoint *a, Syncpoint *b); -int ff_nut_sp_pts_cmp(Syncpoint *a, Syncpoint *b); +int ff_nut_sp_pos_cmp(const Syncpoint *a, const Syncpoint *b); +int ff_nut_sp_pts_cmp(const Syncpoint *a, const Syncpoint *b); void ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts); void ff_nut_free_sp(NUTContext *nut); diff -r 7028f9476da4 -r dbbcecb1a0dd nutdec.c --- a/nutdec.c Sun Mar 28 08:48:45 2010 +0000 +++ b/nutdec.c Sun Mar 28 09:59:58 2010 +0000 @@ -859,7 +859,8 @@ pos2= st->index_entries[index].pos; ts = st->index_entries[index].timestamp; }else{ - av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pts_cmp, (void **) next_node); + av_tree_find(nut->syncpoints, &dummy, (void *) 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 , next_node[1]->ts); pos= av_gen_search(s, -1, dummy.ts, next_node[0]->pos, next_node[1]->pos, next_node[1]->pos, @@ -868,7 +869,8 @@ if(!(flags & AVSEEK_FLAG_BACKWARD)){ dummy.pos= pos+16; next_node[1]= &nopts_sp; - av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pos_cmp, (void **) next_node); + av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp, + (void **) next_node); pos2= av_gen_search(s, -2, dummy.pos, next_node[0]->pos , next_node[1]->pos, next_node[1]->pos, next_node[0]->back_ptr, next_node[1]->back_ptr, flags, &ts, nut_read_timestamp); if(pos2>=0) @@ -876,7 +878,8 @@ //FIXME dir but I think it does not matter } dummy.pos= pos; - sp= av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pos_cmp, NULL); + sp= av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp, + NULL); assert(sp); pos2= sp->back_ptr - 15; diff -r 7028f9476da4 -r dbbcecb1a0dd nutenc.c --- a/nutenc.c Sun Mar 28 08:48:45 2010 +0000 +++ b/nutenc.c Sun Mar 28 09:59:58 2010 +0000 @@ -677,7 +677,8 @@ } if(dummy.pos == INT64_MAX) dummy.pos= 0; - sp= av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pos_cmp, NULL); + sp= av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp, + NULL); nut->last_syncpoint_pos= url_ftell(bc); ret = url_open_dyn_buf(&dyn_bc);