diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2023-05-13 01:13:05 +0800 |
---|---|---|
committer | Zhao Zhili <zhilizhao@tencent.com> | 2023-05-20 04:03:44 +0800 |
commit | 47430a3cb18c77f6c148eee7c528abc2e8bf3e91 (patch) | |
tree | 08563974f22e945dd4c37ccd210e86ba106b718a /libavcodec/cavs_parser.c | |
parent | 283813897519d48bfdc3acb974e82f034f8a7727 (diff) | |
download | ffmpeg-47430a3cb18c77f6c148eee7c528abc2e8bf3e91.tar.gz |
avcodec/cavs_parser: fix finding the end of a frame
Use the next I/P/B or start code as the end of current frame.
Before the patch, extension start code, user data start code,
sequence end code and so on are treated as the start of next
frame.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'libavcodec/cavs_parser.c')
-rw-r--r-- | libavcodec/cavs_parser.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/cavs_parser.c b/libavcodec/cavs_parser.c index 03f392c2e5..4a03effd0f 100644 --- a/libavcodec/cavs_parser.c +++ b/libavcodec/cavs_parser.c @@ -59,12 +59,11 @@ static int cavs_find_frame_end(ParseContext *pc, const uint8_t *buf, return 0; for(; i<buf_size; i++){ state= (state<<8) | buf[i]; - if((state&0xFFFFFF00) == 0x100){ - if(state > SLICE_MAX_START_CODE){ - pc->frame_start_found=0; - pc->state=-1; - return i-3; - } + if (state == PIC_I_START_CODE || state == PIC_PB_START_CODE || + state == CAVS_START_CODE) { + pc->frame_start_found=0; + pc->state=-1; + return i-3; } } } |