diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-12-30 13:02:38 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-01-10 16:04:19 +0100 |
commit | 63b013aa687662440c85ecff8fdc087123025bf6 (patch) | |
tree | a364c860031738736685911e2265f27367b9b477 /libavutil/fifo.h | |
parent | d47dc0b0dfcc6010a57d4f2510c90b800ed40efc (diff) |
lavu/fifo: deprecate av_fifo_peek2()
It returns a pointer inside the fifo's buffer, which cannot be safely
used without accessing AVFifoBuffer internals. It is easier and safer to
use av_fifo_generic_peek_at().
Diffstat (limited to 'libavutil/fifo.h')
-rw-r--r-- | libavutil/fifo.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/fifo.h b/libavutil/fifo.h index dc7bc6f0dd..92b1cf50e4 100644 --- a/libavutil/fifo.h +++ b/libavutil/fifo.h @@ -156,6 +156,7 @@ int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space); */ void av_fifo_drain(AVFifoBuffer *f, int size); +#if FF_API_FIFO_PEEK2 /** * Return a pointer to the data stored in a FIFO buffer at a certain offset. * The FIFO buffer is not modified. @@ -165,7 +166,9 @@ void av_fifo_drain(AVFifoBuffer *f, int size); * than the used buffer size or the returned pointer will * point outside to the buffer data. * The used buffer size can be checked with av_fifo_size(). + * @deprecated use av_fifo_generic_peek_at() */ +attribute_deprecated static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) { uint8_t *ptr = f->rptr + offs; @@ -175,5 +178,6 @@ static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) ptr = f->end - (f->buffer - ptr); return ptr; } +#endif #endif /* AVUTIL_FIFO_H */ |