ce689aec by Gary Katsevman

Always write out metadata at the start of segments

In some cases (most likely badly encoded video), segments didn't start
with a keyframe so they ended up getting squished because flash didn't
know how to play them.
1 parent 56520081
......@@ -283,7 +283,9 @@
newExtraData = new H264ExtraData();
}
if (h264Frame.keyFrame) {
// Check if keyframe and the length of tags.
// This makes sure we write metadata on the first frame of a segment.
if (h264Frame.keyFrame || this.tags.length === 0) {
// Push extra data on every IDR frame in case we did a stream change + seek
this.tags.push(oldExtraData.metaDataTag(h264Frame.pts));
this.tags.push(oldExtraData.extraDataTag(h264Frame.pts));
......