Skip to content

Commit

Permalink
Account for flags and version when parsing an EMSG box.
Browse files Browse the repository at this point in the history
Added version and flag bytes to the test code.
Added the code to skip version and flag bytes when
parsing an EMSG box.

Closes #259.

Change-Id: Iac94785f747ec6ffb640c5b4f803e68e0c7b27cb
  • Loading branch information
ismena committed Aug 9, 2016
1 parent b069eda commit f5f4473
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,8 @@ shaka.dash.DashParser.prototype.emsgResponseFilter_ = function(type, response) {
if (boxSize != shaka.util.Mp4Parser.BOX_NOT_FOUND) {
var start = reader.getPosition() - 8;
var end = start + boxSize;
// skip version and flags
reader.skip(4);
var scheme_id = reader.readTerminatedString();
// scheme_id of "urn:mpeg:dash:event:2012" means it's
// time to update the manifest
Expand Down
22 changes: 11 additions & 11 deletions test/dash/dash_parser_manifest_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,20 +764,20 @@ describe('DashParser.Manifest', function() {
]);

var emsgUpdate = new Uint8Array([
0, 0, 0, 48, 101, 109, 115, 103,
117, 114, 110, 58, 109, 112, 101,
103, 58, 100, 97, 115, 104, 58,
101, 118, 101, 110, 116, 58, 50,
48, 49, 50, 0, 0, 0, 49, 0, 0, 0,
8, 0, 0, 255, 255, 116, 101, 115,
116
0, 0, 0, 52, 101, 109, 115, 103,
0, 0, 0, 0, 117, 114, 110, 58,
109, 112, 101, 103, 58, 100, 97,
115, 104, 58, 101, 118, 101, 110,
116, 58, 50, 48, 49, 50, 0, 0, 0,
49, 0, 0, 0, 8, 0, 0, 255, 255, 116,
101, 115, 116
]);

var emsgCustom = new Uint8Array([
0, 0, 0, 55, 101, 109, 115, 103,
102, 111, 111, 58, 98, 97, 114,
58, 99, 117, 115, 116, 111, 109,
100, 97, 116, 97, 115, 99, 104,
0, 0, 0, 59, 101, 109, 115, 103,
0, 0, 0, 0, 102, 111, 111, 58, 98,
97, 114, 58, 99, 117, 115, 116, 111,
109, 100, 97, 116, 97, 115, 99, 104,
101, 109, 101, 0, 49, 0, 0, 0, 0,
1, 0, 0, 0, 8, 0, 0, 255, 255, 0,
0, 0, 1, 116, 101, 115, 116
Expand Down

0 comments on commit f5f4473

Please sign in to comment.