]> id.pley.net Git - movie_parser.git/commitdiff
Fixed TrackHeaderAtom inheritance chain, which was causing a parsing bug. Made the...
authorJer Noble <jer.noble@apple.com>
Fri, 7 Dec 2012 22:22:08 +0000 (14:22 -0800)
committerJer Noble <jer.noble@apple.com>
Fri, 7 Dec 2012 22:22:08 +0000 (14:22 -0800)
Atom.js
AtomTester.html

diff --git a/Atom.js b/Atom.js
index 52e9e59ab28031776fb70bf6bd4c89993c166f1a..2fc62ef76f9cb86fb6b7fab005807e935e8c5379 100644 (file)
--- a/Atom.js
+++ b/Atom.js
@@ -332,7 +332,7 @@ var TrackHeaderAtom = function(buffer, offset) {
     this.super(TrackHeaderAtom).constructor.call(this, buffer, offset);
 }
 
-TrackHeaderAtom.prototype = Object.create(Atom.prototype);
+TrackHeaderAtom.prototype = Object.create(VersionFlagsAtom.prototype);
 
 TrackHeaderAtom.prototype.setDefaults = function() {
     this.super(TrackHeaderAtom).setDefaults.call(this);
index d0bcbf133020e5d26f5e630ddd3b8789e1edbbfb..26172643932f28a827bb6ebe664a8f5b0f1da7ee 100644 (file)
@@ -3,6 +3,10 @@
     <title>AtomTester</title>
     <script src=Atom.js></script>
     <script>
+        // Add Blob.prototype.slice if it does not already exist:
+        if (typeof(Blob.prototype.slice) == 'undefined' && typeof(Blob.prototype.webkitSlice) != 'undefined')
+            Blob.prototype.slice = Blob.prototype.webkitSlice;
+
         var moovAtom;
         function onFileSelect(e) {
             var file = e.target.files[0];
@@ -20,7 +24,7 @@
                     else
                         checkForMoovAtom(offset + basicAtom.size);
                 };
-                var subset = file.webkitSlice(offset, offset + 16);
+                var subset = file.slice(offset, offset + 16);
                 reader.readAsArrayBuffer(subset);
             };
             
@@ -30,7 +34,7 @@
                     var output = document.getElementById('output');
                     output.appendChild(toDOMNode(moovAtom));
                 };
-                var subset = file.webkitSlice(offset, offset + length);
+                var subset = file.slice(offset, offset + length);
                 reader.readAsArrayBuffer(subset);
             };
             
@@ -70,7 +74,7 @@
                     continue;
                 var div = document.createElement('div');
                 var dt = document.createElement('dt');
-                dt.innerText = property;
+                dt.appendChild(document.createTextNode(property));
                 var dd = document.createElement('dd');
                 dd.appendChild(toDOMRepresentation(value));
                 div.appendChild(dt);