History

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.

Zhao Zhili committed 3 years ago

Commit 47430a31 parent 28381383 files · +70 −6Browse files

Showing the changes to libavcodec (1 of 3 files). Show all

Unified · Split

libavcodec/cavs_parser.c+5−6
@@ -59,12 +59,11 @@ static int cavs_find_frame_end(ParseContext *pc, const uint8_t *buf, · 58 unmodified lines
5959 return 0;
6060 for(; i<buf_size; i++){
6161 state= (state<<8) | buf[i];
62− if((state&0xFFFFFF00) == 0x100){
63− if(state > SLICE_MAX_START_CODE){
64− pc->frame_start_found=0;
65− pc->state=-1;
66− return i-3;
67− }
62+ if (state == PIC_I_START_CODE || state == PIC_PB_START_CODE ||
63+ state == CAVS_START_CODE) {
64+ pc->frame_start_found=0;
65+ pc->state=-1;
66+ return i-3;
6867 }
6968 }
7069 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t