Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCalculate correct mp4 header length. #9618
Conversation
highfive
commented
Feb 12, 2016
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @pcwalton (or someone else) soon. |
| &[0x00, 0x00, 0x01, 0x04, 0x66, 0x74, 0x79, 0x70, 0x6D, 0x70, 0x34] | ||
| ); | ||
|
|
||
| println!("Data Length {:?}", data.len()); |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r+ Thanks! |
|
|
| ); | ||
|
|
||
| println!("Data Length {:?}", data.len()); | ||
| if !matcher.matches(&data) { |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r- Sorry, didn't see @jdm's comment |
|
This change looks great, and thank you for including a test! How did you notice this? :) |
|
@jdm Just reading code to get more familiar with Rust. |
|
Please squash the commits into one, and then I'll merge it. Thanks! |
|
Squashed and force pushed. Hope that's right. Thanks for the impressively quick response. |
|
@bors-servo: r+ |
|
|
Calculate correct mp4 header length. The calculation of MP4 frame length is incorrect, shifting values by 1 bit instead of 8 bits. It works for the test MP4 file because the length of the frame is less than 256 bytes, so the shifted values are all zero. This PR changes the code to calculate the length correctly. It adds a test to check a fake long stream. Still not long enough to test completely, but at least detects the problem with the original code. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9618) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
Calculate correct mp4 header length. The calculation of MP4 frame length is incorrect, shifting values by 1 bit instead of 8 bits. It works for the test MP4 file because the length of the frame is less than 256 bytes, so the shifted values are all zero. This PR changes the code to calculate the length correctly. It adds a test to check a fake long stream. Still not long enough to test completely, but at least detects the problem with the original code. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9618) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
|
|
|
|
jongiddy commentedFeb 12, 2016
The calculation of MP4 frame length is incorrect, shifting values by 1 bit instead of 8 bits. It works for the test MP4 file because the length of the frame is less than 256 bytes, so the shifted values are all zero.
This PR changes the code to calculate the length correctly. It adds a test to check a fake long stream. Still not long enough to test completely, but at least detects the problem with the original code.