Commit 47430a3c authored by Zhao Zhili's avatar Zhao Zhili

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: 's avatarZhao Zhili <zhilizhao@tencent.com>
parent 28381389
......@@ -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;
}
}
}
......
......@@ -29,6 +29,9 @@ fate-bcstm: CMD = crc -i $(TARGET_SAMPLES)/bfstm/loz-mm-mikau.bcstm -c:a copy
FATE_SAMPLES_DEMUX-$(CONFIG_BRSTM_DEMUXER) += fate-brstm
fate-brstm: CMD = crc -i $(TARGET_SAMPLES)/brstm/lozswd_partial.brstm -c:a copy
FATE_FFPROBE_DEMUX-$(call ALLYES, CAVSVIDEO_DEMUXER CAVSVIDEO_PARSER) += fate-cavs-demux
fate-cavs-demux: CMD = ffprobe_demux $(TARGET_SAMPLES)/cavs/bunny.cavs
FATE_SAMPLES_DEMUX-$(CONFIG_CDXL_DEMUXER) += fate-cdxl-demux
fate-cdxl-demux: CMD = framecrc -i $(TARGET_SAMPLES)/cdxl/mirage.cdxl -c:v copy -c:a copy
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment