MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / av_fifo_alloc2

Function av_fifo_alloc2

libavutil/fifo.c:47–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45};
46
47AVFifo *av_fifo_alloc2(size_t nb_elems, size_t elem_size,
48 unsigned int flags)
49{
50 AVFifo *f;
51 void *buffer = NULL;
52
53 if (!elem_size)
54 return NULL;
55
56 if (nb_elems) {
57 buffer = av_realloc_array(NULL, nb_elems, elem_size);
58 if (!buffer)
59 return NULL;
60 }
61 f = av_mallocz(sizeof(*f));
62 if (!f) {
63 av_free(buffer);
64 return NULL;
65 }
66 f->buffer = buffer;
67 f->nb_elems = nb_elems;
68 f->elem_size = elem_size;
69 f->is_empty = 1;
70
71 f->flags = flags;
72 f->auto_grow_limit = FFMAX(AUTO_GROW_DEFAULT_BYTES / elem_size, 1);
73
74 return f;
75}
76
77void av_fifo_auto_grow_limit(AVFifo *f, size_t max_elems)
78{

Callers 15

start_jackFunction · 0.85
ring_initFunction · 0.85
swf_write_headerFunction · 0.85
udp_openFunction · 0.85
mpeg_mux_initFunction · 0.85
dv_init_muxFunction · 0.85
av_container_fifo_allocFunction · 0.85
av_audio_fifo_allocFunction · 0.85
mainFunction · 0.85
ifilter_allocFunction · 0.85
fg_thread_initFunction · 0.85

Calls 3

av_realloc_arrayFunction · 0.85
av_malloczFunction · 0.70
av_freeFunction · 0.70

Tested by 1

mainFunction · 0.68