[Ffmpeg-cvslog] r7031 - in trunk/libavutil: Makefile tree.c tree.h

Daniel Serpell daniel.serpell
Tue Nov 14 04:05:51 CET 2006


Hi!

On 11/13/06, M?ns Rullg?rd <mru at inprovide.com> wrote:
>
> "Daniel Serpell" <daniel.serpell at gmail.com> writes:
> >>
> >> +    AVTreeNode *root= av_mallocz(sizeof(AVTreeNode));
>
> That won't work with the header only.  It declares AVTreeNode as an
> opaque struct.

Yes, you are right, so try this:

+int main(){
+   int i,j,k;
+   AVTreeNode *root= 0;
+
+    for(i=0; i<10000; i++){
+       int j= (random()%863294);
[...]
+        av_log(NULL, AV_LOG_ERROR, "inserting %4d\n", j);
+        av_tree_insert(&root, (void*)(j+1), cmp);
+    }
+    return 0;
+}

The root is allocated at first insertion (when root == 0).

    Daniel.




More information about the ffmpeg-cvslog mailing list