1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
20
21 #include <stdint.h>
22
26
28 {
29 if (t) {
32
33 if (left > 999 || right > 999)
34 return 1000;
35 if (right - left != t->
state)
36 return 1000;
38 return 1000;
39 return FFMAX(left, right) + 1;
40 }
41 return 0;
42 }
43
45 {
46 int i;
47 for (i = 0; i < depth * 4; i++)
49 if (t) {
53 } else
55 }
56
57 static int cmp(
const void *
a,
const void *
b)
58 {
60 }
61
62 int main(
int argc,
char **argv)
63 {
64 int i;
65 void *k;
68 int log_level = argc <= 1 ?
AV_LOG_INFO : atoi(argv[1]);
69
71
73
74 for (i = 0; i < 10000; i++) {
76
77 if (
check(root) > 999) {
80 return 1;
81 }
83
84 if (!node)
86 if (!node) {
88 return 1;
89 }
91
93 {
98 if (k)
101 }
102 }
104
106
107 return 0;
108 }
void av_log_set_level(int level)
Set the log level.
int main(int argc, char **argv)
void * av_tree_find(const AVTreeNode *t, void *key, int(*cmp)(const void *key, const void *b), void *next[2])
struct AVTreeNode * av_tree_node_alloc(void)
Allocate an AVTreeNode.
void av_tree_destroy(AVTreeNode *t)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
struct AVTreeNode * child[2]
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_INFO
Standard information.
static int cmp(const void *a, const void *b)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
static int check(AVTreeNode *t)
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
common internal and external API header
void * av_tree_insert(AVTreeNode **tp, void *key, int(*cmp)(const void *key, const void *b), AVTreeNode **next)
Insert or remove an element.
static void print(AVTreeNode *t, int depth)