8000 cea708 wrap around issue · Issue #75 · szatmary/libcaption · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cea708 wrap around issue #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rexvl opened this issue Apr 10, 2025 · 0 comments
Open

cea708 wrap around issue #75

rexvl opened this issue Apr 10, 2025 · 0 comments

Comments

@rexvl
Copy link
rexvl commented Apr 10, 2025

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.

cea708_wrap_around.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0