download getid3.matroska.php
Language: PHP
LOC: 30
Project Info
Tunez
Server: SourceForge
Type: cvs
...tunez\tunez\tunez\html\id3\
   getid3.aac.php
   getid3.ape.php
   getid3.asf.php
   getid3.au.php
   getid3.avr.php
   getid3.bmp.php
   getid3.bonk.php
   getid3.check.php
   getid3.exe.php
   getid3.flac.php
   getid3.frames.php
   getid3.functions.php
   getid3.getimagesize.php
   getid3.gif.php
   getid3.id3v1.php
   getid3.id3v2.php
   getid3.iso.php
   getid3.jpg.php
   getid3.la.php
   getid3.lookup.php
   getid3.lpac.php
   getid3.lyrics3.php
   getid3.matroska.php
   getid3.midi.php
   getid3.mod.php
   getid3.monkey.php
   getid3.mp3.php
   getid3.mpc.php
   getid3.mpeg.php
   getid3.nsv.php
   getid3.ogg.php
   getid3.ogginfo.php
   getid3.optimfrog.php
   getid3.php
   getid3.png.php
   getid3.putid3.php
   getid3.quicktime.php
   getid3.rar.php
   getid3.real.php
   getid3.rgad.php
   getid3.riff.php
   getid3.shorten.php
   getid3.swf.php
   getid3.thumbnail.php
   getid3.voc.php
   getid3.vqf.php
   getid3.write.php
   getid3.zip.php

<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org>               //
//  available at http://getid3.sourceforge.net                ///
//            or http://www.getid3.org                        ///
/////////////////////////////////////////////////////////////////
//                                                             //
// getid3.matroska.php - part of getID3()                      //
// See getid3.readme.txt for more details                      //
//                                                             //
/////////////////////////////////////////////////////////////////

function getMatroskaHeaderFilepointer(&$fd, &$ThisFileInfo) {

	$ThisFileInfo['fileformat'] = 'matroska';

	fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);

	//$ThisFileInfo['matroska']['raw']['a'] = EBML2Int(fread($fd, 4));

	$ThisFileInfo['error'] .= "\n".'Mastroka parsing not enabled in this version of getID3()';
	return false;

}

function EBML2Int($EBMLstring) {
	// http://matroska.org/specs/

	// Element ID coded with an UTF-8 like system:
	// 1xxx xxxx                                  - Class A IDs (2^7 -2 possible values) (base 0x8X)
	// 01xx xxxx  xxxx xxxx                       - Class B IDs (2^14-2 possible values) (base 0x4X 0xXX)
	// 001x xxxx  xxxx xxxx  xxxx xxxx            - Class C IDs (2^21-2 possible values) (base 0x2X 0xXX 0xXX)
	// 0001 xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx - Class D IDs (2^28-2 possible values) (base 0x1X 0xXX 0xXX 0xXX)
	// Values with all x at 0 and 1 are reserved (hence the -2).

	// Data size, in octets, is also coded with an UTF-8 like system :
	// 1xxx xxxx                                                                              - value 0 to  2^7-2
	// 01xx xxxx  xxxx xxxx                                                                   - value 0 to 2^14-2
	// 001x xxxx  xxxx xxxx  xxxx xxxx                                                        - value 0 to 2^21-2
	// 0001 xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx                                             - value 0 to 2^28-2
	// 0000 1xxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx                                  - value 0 to 2^35-2
	// 0000 01xx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx                       - value 0 to 2^42-2
	// 0000 001x  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx            - value 0 to 2^49-2
	// 0000 0001  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx - value 0 to 2^56-2

	if (0x80 & ord($EBMLstring{0})) {
		$EBMLstring{0} = chr(ord($EBMLstring{0}) & 0x7F);
	} elseif (0x40 & ord($EBMLstring{0})) {
		$EBMLstring{0} = chr(ord($EBMLstring{0}) & 0x3F);
	} elseif (0x20 & ord($EBMLstring{0})) {
		$EBMLstring{0} = chr(ord($EBMLstring{0}) & 0x1F);
	} elseif (0x10 & ord($EBMLstring{0})) {
		$EBMLstring{0} = chr(ord($EBMLstring{0}) & 0x0F);
	} elseif (0x08 & ord($EBMLstring{0})) {
		$EBMLstring{0} = chr(ord($EBMLstring{0}) & 0x07);
	} elseif (0x04 & ord($EBMLstring{0})) {
		$EBMLstring{0} = chr(ord($EBMLstring{0}) & 0x03);
	} elseif (0x02 & ord($EBMLstring{0})) {
		$EBMLstring{0} = chr(ord($EBMLstring{0}) & 0x01);
	} elseif (0x01 & ord($EBMLstring{0})) {
		$EBMLstring{0} = chr(ord($EBMLstring{0}) & 0x00);
	} else {
		return false;
	}
	return BigEndian2Int($EBMLstring);
}

?>

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us