-
Notifications
You must be signed in to change notification settings - Fork 522
[Rust]Ported ES Module to Rust #1736
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
[Rust]Ported ES Module to Rust #1736
Conversation
src/rust/src/es/gop.rs
Outdated
| } | ||
|
|
||
| if esstream.bits_left < 0 { | ||
| esstream.init_bitstream(gop_info_start_pos, gop_info_start_bpos as usize)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be this? I think this has wrong parameters:
esstream.init_bitstream(gop_info_start_pos, esstream.data.len())?;
esstream.bpos = gop_info_start_bpos;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this was a mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/rust/src/es/userdata.rs
Outdated
| let hi = cc_data[1] & 0x7F; // Get rid of parity bit | ||
| let lo = cc_data[2] & 0x7F; // Get rid of parity bit | ||
| if hi >= 0x20 { | ||
| output = format!("{}{}", hi as char, if lo >= 20 { lo as char } else { '.' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the lo >= 20 correct or should it be lo >= 0x20?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same in C, so I guess it's fine.
if (cc_valid && cc_type == channel)
{
hi = cc_data[1] & 0x7F; // Get rid of parity bit
lo = cc_data[2] & 0x7F; // Get rid of parity bit
if (hi >= 0x20)
{
output[0] = hi;
output[1] = (lo >= 20 ? lo : '.'); // here
output[2] = '\x00';
}
else
{
output[0] = '<';
output[1] = '>';
output[2] = '\x00';
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I make it 0x20?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, make it 0x20 for both versions, since ASCII printable characters starts at 0x20 and not 20.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
prateekmedia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit ba59eb0...:
All tests passing on the master branch were passed completely. Check the result page for more info. |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 12a27f3...:
All tests passing on the master branch were passed completely. Check the result page for more info. |
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
This PR ports the entire
es_functions.candes_userdata.cfiles to Rust.Tested on This sample