{"action":"created","issue":{"url":"https://api.github.com/repos/dailymotion/hls.js/issues/6","labels_url":"https://api.github.com/repos/dailymotion/hls.js/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/dailymotion/hls.js/issues/6/comments","events_url":"https://api.github.com/repos/dailymotion/hls.js/issues/6/events","html_url":"https://github.com/dailymotion/hls.js/issues/6","id":107693043,"number":6,"title":"support NAL unit overlapping between PES packets","user":{"login":"tjenkinson","id":3259993,"avatar_url":"https://avatars.githubusercontent.com/u/3259993?v=3","gravatar_id":"","url":"https://api.github.com/users/tjenkinson","html_url":"https://github.com/tjenkinson","followers_url":"https://api.github.com/users/tjenkinson/followers","following_url":"https://api.github.com/users/tjenkinson/following{/other_user}","gists_url":"https://api.github.com/users/tjenkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tjenkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjenkinson/subscriptions","organizations_url":"https://api.github.com/users/tjenkinson/orgs","repos_url":"https://api.github.com/users/tjenkinson/repos","events_url":"https://api.github.com/users/tjenkinson/events{/privacy}","received_events_url":"https://api.github.com/users/tjenkinson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dailymotion/hls.js/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-22T11:11:51Z","updated_at":"2015-09-22T13:43:38Z","closed_at":null,"body":"Hi @mangui firstly thanks for open sourcing this!\r\n\r\nHaving a few issues with our live stream, and from running some tests it appears to only crop up with higher resolutions. The audio always seems to be fine but the video locks up and goes streaky.\r\n\r\nAll my tests have been in Chrome.\r\n\r\nHere are some of our urls:\r\n- 160p only (which appears to work): http://dailymotion.github.io/hls.js/demo/?src=https%3A%2F%2Fstream1.la1tv.co.uk%3A1936%2Flive%2Fstudio_out_160p%2Fplaylist.m3u8\r\n- 360p only (which seems unreliable): http://dailymotion.github.io/hls.js/demo/?src=https%3A%2F%2Fstream1.la1tv.co.uk%3A1936%2Flive%2Fstudio_out_360p%2Fplaylist.m3u8\r\n- 720p only (which freezes pretty much instantly): http://dailymotion.github.io/hls.js/demo/?src=https%3A%2F%2Fstream1.la1tv.co.uk%3A1936%2Flive%2Fstudio_out_720p%2Fplaylist.m3u8\r\n- varient playlist: http://dailymotion.github.io/hls.js/demo/?src=https%3A%2F%2Fstream1.la1tv.co.uk%3A1936%2Flive%2Fngrp%3Astudio_out_all%2Fplaylist.m3u8\r\n\r\nWe are using wowza as the streaming server.\r\n\r\nAll of the above urls work fine on iOS and in your flashls player.\r\n\r\nAny ideas what might be wrong?\r\n\r\nThanks!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dailymotion/hls.js/issues/comments/142293221","html_url":"https://github.com/dailymotion/hls.js/issues/6#issuecomment-142293221","issue_url":"https://api.github.com/repos/dailymotion/hls.js/issues/6","id":142293221,"user":{"login":"tjenkinson","id":3259993,"avatar_url":"https://avatars.githubusercontent.com/u/3259993?v=3","gravatar_id":"","url":"https://api.github.com/users/tjenkinson","html_url":"https://github.com/tjenkinson","followers_url":"https://api.github.com/users/tjenkinson/followers","following_url":"https://api.github.com/users/tjenkinson/following{/other_user}","gists_url":"https://api.github.com/users/tjenkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tjenkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjenkinson/subscriptions","organizations_url":"https://api.github.com/users/tjenkinson/orgs","repos_url":"https://api.github.com/users/tjenkinson/repos","events_url":"https://api.github.com/users/tjenkinson/events{/privacy}","received_events_url":"https://api.github.com/users/tjenkinson/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T13:43:37Z","updated_at":"2015-09-22T13:43:37Z","body":"This looking right?\r\n\r\n```js\r\n _parseAVCPES(pes) {\r\n    var units,track = this._avcTrack,avcSample,key = false;\r\n    units = this._parseAVCNALu(pes.data);\r\n    // no NALu found\r\n    if(units.length === 0) {\r\n      // append pes.data to previous NAL unit\r\n      var lastavcSample = this._avcSamples[this._avcSamples.length-1];\r\n      var lastUnit = lastavcSample.units.units[lastavcSample.units.units.length-1];\r\n      var tmp = new Uint8Array(lastUnit.data.byteLength+pes.data.byteLength);\r\n      tmp.set(lastUnit.data,0);\r\n      tmp.set(pes.data,lastUnit.data.byteLength);\r\n      lastUnit.data = tmp;\r\n      lastavcSample.units.length+=pes.data.byteLength;\r\n      this._avcSamplesLength+=pes.data.byteLength;\r\n    }\r\n    //free pes.data to save up some memory\r\n    pes.data = null;\r\n    units.units.forEach(unit => {\r\n```\r\n\r\nHow does it know if it's not got a complete NAL unit though in the first packet?"}}