Skip to content

decoding no longer fails when unrepresentable tag size is encountered - #10

Merged
themasch merged 3 commits into
node-ebml:masterfrom
eadle:master
Jul 21, 2015
Merged

themasch merged 3 commits into
node-ebml:masterfrom
eadle:master

Conversation

@eadle

@eadle eadle commented Jul 17, 2015

Copy link
Copy Markdown
Contributor

I'm not sure if an unknown element size is only encountered with Matroska livestreams, but this made webm livestreaming possible for me. I'd like to use node-ebml as a dependency rather than forking it. Instead of throwing an error when encountering an unrepresentable tag size, the end should be treated as unknown.

Fix to issue #8.

@themasch

Copy link
Copy Markdown
Contributor

Hi, Thanks for you PR.
Could you please update the unit tests so travis is happy?

@eadle

eadle commented Jul 17, 2015

Copy link
Copy Markdown
Contributor Author

I should really start using these unit tests.

Just commented out the greater than max representable for now. All Matroska says is that an unknown element size should be represented by all 1's, so I can't imagine there would be a need to use more than 8 bytes.

@eadle

eadle commented Jul 18, 2015

Copy link
Copy Markdown
Contributor Author

Were you wanting a new unit test for a sample livestream? I could probably make a Big Buck Bunny livestream sample.

@themasch

Copy link
Copy Markdown
Contributor

You could add a test that checks if the return value for readVint equals { length: x, value: -1 } so we would see if this expected behavior changes in the future.
Should be as simple as this:

it('put a clever message here', function() {
    readVint(new Buffer([0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]), -1);
});

Have a look at the (bad named) readVint test function here: https://github.com/siphontv/node-ebml/blob/master/test/ebml.js#L7

@eadle

eadle commented Jul 20, 2015

Copy link
Copy Markdown
Contributor Author

Good call. Let me know if you want any other changes (or a more clever message).

themasch added a commit that referenced this pull request Jul 21, 2015
decoding no longer fails when unrepresentable tag size is encountered
@themasch
themasch merged commit ee60a00 into node-ebml:master Jul 21, 2015
@themasch

Copy link
Copy Markdown
Contributor

👍

@eadle

eadle commented Jul 21, 2015

Copy link
Copy Markdown
Contributor Author

Sweet! Thanks for the merge.

I'm pretty new to node. Do you have to update the version for npm? npm install doesn't include the changes. Maybe 0.2.1?

@themasch

Copy link
Copy Markdown
Contributor

Oh, right. Well. Since this is a change in the api 1.0.0 would be correct, wouldn't it?

@themasch themasch mentioned this pull request Jul 22, 2015
@themasch

Copy link
Copy Markdown
Contributor

Okay, published to npm as [email protected]

@vhmth

vhmth commented Apr 6, 2017

Copy link
Copy Markdown

Should lines 10 and 11 of lib/ebml/tools.js have been modified/removed as well?

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

Successfully merging this pull request may close these issues.

3 participants