| 101 | } |
| 102 | |
| 103 | AVBufferRef *av_buffer_ref(const AVBufferRef *buf) |
| 104 | { |
| 105 | AVBufferRef *ret = av_mallocz(sizeof(*ret)); |
| 106 | |
| 107 | if (!ret) |
| 108 | return NULL; |
| 109 | |
| 110 | *ret = *buf; |
| 111 | |
| 112 | atomic_fetch_add_explicit(&buf->buffer->refcount, 1, memory_order_relaxed); |
| 113 | |
| 114 | return ret; |
| 115 | } |
| 116 | |
| 117 | static void buffer_replace(AVBufferRef **dst, AVBufferRef **src) |
| 118 | { |