diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-05-28 17:43:56 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-26 20:38:30 +0200 |
commit | 94dc3385e498ee408275fdf9107b995afa917115 (patch) | |
tree | 8a6244179240b0804571ffb7626918bc6bcd56db | |
parent | a902c24994dea7cbdf84bff70ad8709958b1008d (diff) | |
download | ffmpeg-94dc3385e498ee408275fdf9107b995afa917115.tar.gz |
avcodec/bytestream: Add unchecked bytestream2 peek functions
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r-- | libavcodec/bytestream.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index 0516a6e3dc..d0033f14f3 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -77,11 +77,15 @@ static av_always_inline type bytestream2_get_ ## name(GetByteContext *g) \ } \ return bytestream2_get_ ## name ## u(g); \ } \ +static av_always_inline type bytestream2_peek_ ## name ## u(GetByteContext *g) \ +{ \ + return read(g->buffer); \ +} \ static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \ { \ if (g->buffer_end - g->buffer < bytes) \ return 0; \ - return read(g->buffer); \ + return bytestream2_peek_ ## name ## u(g); \ } DEF(uint64_t, le64, 8, AV_RL64, AV_WL64) |