API changes, most recent first:
+2010-03-03 - r22174 - lavu 50.10.0 - av_tree_enumerate()
+ Add av_tree_enumerate().
+
2010-02-07 - r21673 - lavu 50.9.0 - av_compare_ts()
Add av_compare_ts().
}
}
+static void enu_free(void *opaque, void *elem)
+{
+ av_free(elem);
+}
+
+void ff_nut_free_sp(NUTContext *nut)
+{
+ av_tree_enumerate(nut->syncpoints, NULL, NULL, enu_free);
+ av_tree_destroy(nut->syncpoints);
+}
+
const Dispositions ff_nut_dispositions[] = {
{"default" , AV_DISPOSITION_DEFAULT},
{"dub" , AV_DISPOSITION_DUB},
int ff_nut_sp_pos_cmp(Syncpoint *a, Syncpoint *b);
int ff_nut_sp_pts_cmp(Syncpoint *a, 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);
extern const Dispositions ff_nut_dispositions[];
av_freep(&nut->time_base);
av_freep(&nut->stream);
+ ff_nut_free_sp(nut);
for(i = 1; i < nut->header_count; i++)
av_freep(&nut->header[i]);
while(nut->header_count<3)
write_headers(nut, bc);
put_flush_packet(bc);
+ ff_nut_free_sp(nut);
av_freep(&nut->stream);
av_freep(&nut->time_base);
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 50
-#define LIBAVUTIL_VERSION_MINOR 9
+#define LIBAVUTIL_VERSION_MINOR 10
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
}
}
-#if 0
void av_tree_enumerate(AVTreeNode *t, void *opaque, int (*cmp)(void *opaque, void *elem), int (*enu)(void *opaque, void *elem)){
if(t){
int v= cmp ? cmp(opaque, t->elem) : 0;
if(v<=0) av_tree_enumerate(t->child[1], opaque, cmp, enu);
}
}
-#endif
#ifdef TEST
void *av_tree_insert(struct AVTreeNode **rootp, void *key, int (*cmp)(void *key, const void *b), struct AVTreeNode **next);
void av_tree_destroy(struct AVTreeNode *t);
+/**
+ * Applies enu(opaque, &elem) to all the elements in the tree in a given range.
+ *
+ * @param cmp a comparison function that returns < 0 for a element below the
+ * range, > 0 for a element above the range and == 0 for a
+ * element inside the range
+ *
+ * @note The cmp function should use the same ordering used to construct the
+ * tree.
+ */
+void av_tree_enumerate(struct AVTreeNode *t, void *opaque, int (*cmp)(void *opaque, void *elem), int (*enu)(void *opaque, void *elem));
+
+
#endif /* AVUTIL_TREE_H */