-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
When we added more then MAX_REFRENCE_FRAMES frames, _mpeg_bitstream_cea708_emplace_back just increases packet->latent.
Then _mpeg_bitstream_cea708_sort hangs on sort array of MAX_REFRENCE_FRAMES elements. Due to cea708 array wrapping, it sorts ring array where 64's element points to first element.
Will be better to move packet->front before insertion if packet->latent >= MAX_REFRENCE_FRAMES as following:
cea708_t* _mpeg_bitstream_cea708_emplace_back(mpeg_bitstream_t* packet, double timestamp)
{
if (packet->latent < MAX_REFRENCE_FRAMES) {
++packet->latent;
} else {
packet->front = (packet->front + 1) % MAX_REFRENCE_FRAMES;
}
cea708_t* cea708 = _mpeg_bitstream_cea708_back(packet);
cea708_init(cea708, timestamp);
return cea708;
}
I added patch to fix the issue.
Metadata
Metadata
Assignees
Labels
No labels