// syncinfo() | bsi() | AB0 | AB1 | AB2 | AB3 | AB4 | AB5 | Aux | CRC
// syncinfo() {
// syncword 16
// crc1 16
// fscod 2
// frmsizecod 6
// } /* end of syncinfo */
$this->
fseek($info['avdataoffset'
]);
$tempAC3header =
$this->
fread(100
); // should be enough to cover all data, there are some variable-length fields...?
$this->AC3header
['syncinfo'
] = getid3_lib::
BigEndian2Int(substr($tempAC3header, 0, 2
));
$this->AC3header
['bsi'
] = getid3_lib::
BigEndian2Bin(substr($tempAC3header, 2
));
$thisfile_ac3_raw_bsi['bsid'
] =
(getid3_lib::
LittleEndian2Int(substr($tempAC3header, 5, 1
)) & 0xF8
) >> 3; // AC3 and E-AC3 put the "bsid" version identifier in the same place, but unfortnately the 4 bytes between the syncword and the version identifier are interpreted differently, so grab it here so the following code structure can make sense
unset($tempAC3header);
if ($this->AC3header
['syncinfo'
] !== self::syncword
) { if (!
$this->
isDependencyFor('matroska'
)) { unset($info['fileformat'
],
$info['ac3'
]);
return $this->
error('Expecting "'.
dechex(self::syncword
).'" at offset '.
$info['avdataoffset'
].', found "'.
dechex($this->AC3header
['syncinfo'
]).'"'
);
} }