1
0
Fork 0

HACK: preserve mpeg2 END_OF_SEQ code to the start of the next frame to cause a implicit decoder flush

This commit is contained in:
Hendrik Leppkes 2012-11-07 22:37:48 +01:00
parent 8a33eb3ef2
commit 0b83a00429
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
1 changed files with 7 additions and 1 deletions

View File

@ -75,9 +75,15 @@ static int mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf,
pc->frame_start_found = 4;
}
if (state == SEQ_END_CODE) {
int idx = i + 1;
/* DVDs won't send the next frame start on still images */
/* SEQ_END_CODE will have to stay at the beginning of the next frame */
if (pc->frame_start_found && i != 3) {
idx = i - 3;
}
pc->frame_start_found = 0;
pc->state = -1;
return i + 1;
return idx;
}
if (pc->frame_start_found == 2 && state == SEQ_START_CODE)
pc->frame_start_found = 0;