$block_data['lace_frames'] = getid3_lib::BigEndian2Int($this->readEBMLelementData(1)) + 1; // Number of frames in the lace-1 (uint8)

if ($block_data['flags']['lacing'] != 0x02) {

for ($i = 1; $i < $block_data['lace_frames']; $i ++) { // Lace-coded size of each frame of the lace, except for the last one (multiple uint8). *This is not used with Fixed-size lacing as it is calculated automatically from (total size of lace) / (number of frames in lace).

if ($block_data['flags']['lacing'] == 0x03) { // EBML lacing

$block_data['lace_frames_size'][$i] = $this->readEBMLint(); // TODO: read size correctly, calc size for the last frame. For now offsets are deteminded OK with readEBMLint() and that's the most important thing.

}

else { // Xiph lacing

$block_data['lace_frames_size'][$i] = 0;

do {

$size = getid3_lib::BigEndian2Int($this->readEBMLelementData(1));

$block_data['lace_frames_size'][$i] += $size;

}

while ($size == 255);

}

}

if ($block_data['flags']['lacing'] == 0x01) { // calc size of the last frame only for Xiph lacing, till EBML sizes are now anyway determined incorrectly