Skip to content

Commit

Permalink
fix video freeze issue with FP 15 / Chrome
Browse files Browse the repository at this point in the history
dont push several times AVCC tags.
related to #66
  • Loading branch information
mangui committed Sep 17, 2014
1 parent fd7c8e8 commit fe0278e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/org/mangui/hls/demux/TSDemuxer.as
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ package org.mangui.hls.demux {
private var _curVideoTag : FLVTag;
/* ADIF tag inserted ? */
private var _adifTagInserted : Boolean = false;
/* AVCC tag inserted ? */
private var _avccTagInserted : Boolean = false;

public static function probe(data : ByteArray) : Boolean {
var pos : uint = data.position;
Expand Down Expand Up @@ -350,7 +352,7 @@ package org.mangui.hls.demux {
ppsvect.push(pps);
}
}
if (sps_found && pps_found) {
if (sps_found && pps_found && _avccTagInserted == false) {
var avcc : ByteArray = AVCC.getAVCC(sps, ppsvect);
var avccTag : FLVTag = new FLVTag(FLVTag.AVC_HEADER, pes.pts, pes.dts, true);
avccTag.push(avcc, 0, avcc.length);
Expand All @@ -359,6 +361,7 @@ package org.mangui.hls.demux {
* this will fix playback issues with some streams for which there is no IDR NAL unit in same PES packet
*/
_curVideoTag.keyframe = true;
_avccTagInserted = true;
}
}

Expand Down

0 comments on commit fe0278e

Please sign in to comment.