c3b6d369 by Benjamin Peterson

write dts to the timestamp part of the flv header, not pts

The Flash decoder expects the FLV timestamp to be the decoding timestamp not the
presentation timestamp. Using pts creates noticable bugs when using a
non-baseline H264 profile.
1 parent 589e8dc4
...@@ -289,10 +289,10 @@ hls.FlvTag = function(type, extraData) { ...@@ -289,10 +289,10 @@ hls.FlvTag = function(type, extraData) {
289 this.bytes[ 2] = (len & 0x0000FF00) >>> 8; 289 this.bytes[ 2] = (len & 0x0000FF00) >>> 8;
290 this.bytes[ 3] = (len & 0x000000FF) >>> 0; 290 this.bytes[ 3] = (len & 0x000000FF) >>> 0;
291 // write the Timestamp 291 // write the Timestamp
292 this.bytes[ 4] = (this.pts & 0x00FF0000) >>> 16; 292 this.bytes[ 4] = (this.dts & 0x00FF0000) >>> 16;
293 this.bytes[ 5] = (this.pts & 0x0000FF00) >>> 8; 293 this.bytes[ 5] = (this.dts & 0x0000FF00) >>> 8;
294 this.bytes[ 6] = (this.pts & 0x000000FF) >>> 0; 294 this.bytes[ 6] = (this.dts & 0x000000FF) >>> 0;
295 this.bytes[ 7] = (this.pts & 0xFF000000) >>> 24; 295 this.bytes[ 7] = (this.dts & 0xFF000000) >>> 24;
296 // write the StreamID 296 // write the StreamID
297 this.bytes[ 8] = 0; 297 this.bytes[ 8] = 0;
298 this.bytes[ 9] = 0; 298 this.bytes[ 9] = 0;
......