summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg4video_parser.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-12 19:51:36 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-20 00:20:15 +0200
commit8edf6c3bf14dd9cd0086922f3a57eb4bef65c7e4 (patch)
treee17fd5f6440460e951fa73b0012a44b94394ec15 /libavcodec/mpeg4video_parser.c
parentdd846bc4a9163f875cc2c4e99325c1a7b4ab8e7d (diff)
avcodec/(h263|mpeg4?video)_parser: Make *_find_frame_end() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpeg4video_parser.c')
-rw-r--r--libavcodec/mpeg4video_parser.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index 1b0e2555da..c68c966259 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -26,7 +26,10 @@
#include "parser.h"
#include "mpegvideo.h"
#include "mpeg4video.h"
+#if FF_API_FLAG_TRUNCATED
+/* Nuke this header when removing FF_API_FLAG_TRUNCATED */
#include "mpeg4video_parser.h"
+#endif
struct Mp4vParseContext {
ParseContext pc;
@@ -34,7 +37,15 @@ struct Mp4vParseContext {
int first_picture;
};
+#if FF_API_FLAG_TRUNCATED
int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
+#else
+/**
+ * Find the end of the current frame in the bitstream.
+ * @return the position of the first byte of the next frame, or -1
+ */
+static int mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
+#endif
{
int vop_found, i;
uint32_t state;
@@ -138,7 +149,11 @@ static int mpeg4video_parse(AVCodecParserContext *s,
if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
next = buf_size;
} else {
+#if FF_API_FLAG_TRUNCATED
next = ff_mpeg4_find_frame_end(pc, buf, buf_size);
+#else
+ next = mpeg4_find_frame_end(pc, buf, buf_size);
+#endif
if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
*poutbuf = NULL;