diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-24 19:35:13 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-26 15:23:08 +0100 |
commit | b531b58b2c9f684ad9408f878453e10908ca94de (patch) | |
tree | 3f4b34bb11407df2ced5e83dbc6495b3ab580d81 /libavcodec/h264_parser.c | |
parent | 6c8e8418241551397bbb671b81430c8774d92a51 (diff) |
avcodec/h264dec: Move find_start_code() to its only user
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/h264_parser.c')
-rw-r--r-- | libavcodec/h264_parser.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index cfbf6f4486..881cab7536 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -64,6 +64,15 @@ typedef struct H264ParseContext { int last_frame_num, last_picture_structure; } H264ParseContext; +static int find_start_code(const uint8_t *buf, int buf_size, + int buf_index, int next_avc) +{ + uint32_t state = -1; + + buf_index = avpriv_find_start_code(buf + buf_index, buf + next_avc + 1, &state) - buf - 1; + + return FFMIN(buf_index, buf_size); +} static int h264_find_frame_end(H264ParseContext *p, const uint8_t *buf, int buf_size, void *logctx) |