2
/////////////////////////////////////////////////////////////////
3
/// getID3() by James Heinrich <info@getid3.org> //
4
// available at http://getid3.sourceforge.net //
5
// or http://www.getid3.org //
6
/////////////////////////////////////////////////////////////////
7
// See readme.txt for more details //
8
/////////////////////////////////////////////////////////////////
10
// module.audio.bink.php //
11
// module for analyzing Bink or Smacker audio-video files //
12
// dependencies: NONE //
14
/////////////////////////////////////////////////////////////////
17
class getid3_bink extends getid3_handler
21
$info = &$this->getid3->info;
23
$info['error'][] = 'Bink / Smacker files not properly processed by this version of getID3() ['.$this->getid3->version().']';
25
fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
26
$fileTypeID = fread($this->getid3->fp, 3);
27
switch ($fileTypeID) {
29
return $this->ParseBink();
33
return $this->ParseSmacker();
37
$info['error'][] = 'Expecting "BIK" or "SMK" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($fileTypeID).'"';
46
function ParseBink() {
47
$info = &$this->getid3->info;
48
$info['fileformat'] = 'bink';
49
$info['video']['dataformat'] = 'bink';
51
$fileData = 'BIK'.fread($this->getid3->fp, 13);
53
$info['bink']['data_size'] = getid3_lib::LittleEndian2Int(substr($fileData, 4, 4));
54
$info['bink']['frame_count'] = getid3_lib::LittleEndian2Int(substr($fileData, 8, 2));
56
if (($info['avdataend'] - $info['avdataoffset']) != ($info['bink']['data_size'] + 8)) {
57
$info['error'][] = 'Probably truncated file: expecting '.$info['bink']['data_size'].' bytes, found '.($info['avdataend'] - $info['avdataoffset']);
63
function ParseSmacker() {
64
$info = &$this->getid3->info;
65
$info['fileformat'] = 'smacker';
66
$info['video']['dataformat'] = 'smacker';
b'\\ No newline at end of file'