Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../ID3
File: module.audio-video.asf.php
[2000] Fix | Delete
$descriptionRecord['name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2001] Fix | Delete
$offset += 2;
[2002] Fix | Delete
[2003] Fix | Delete
$descriptionRecord['data_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2004] Fix | Delete
$offset += 2;
[2005] Fix | Delete
$descriptionRecord['data_type_text'] = self::metadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']);
[2006] Fix | Delete
[2007] Fix | Delete
$descriptionRecord['data_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4));
[2008] Fix | Delete
$offset += 4;
[2009] Fix | Delete
[2010] Fix | Delete
$descriptionRecord['name'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['name_length']);
[2011] Fix | Delete
$offset += $descriptionRecord['name_length'];
[2012] Fix | Delete
[2013] Fix | Delete
$descriptionRecord['data'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['data_length']);
[2014] Fix | Delete
$offset += $descriptionRecord['data_length'];
[2015] Fix | Delete
[2016] Fix | Delete
if (preg_match('#^WM/Picture$#', str_replace("\x00", '', trim($descriptionRecord['name'])))) {
[2017] Fix | Delete
$WMpicture = $this->ASF_WMpicture($descriptionRecord['data']);
[2018] Fix | Delete
foreach ($WMpicture as $key => $value) {
[2019] Fix | Delete
$descriptionRecord['data'] = $WMpicture;
[2020] Fix | Delete
}
[2021] Fix | Delete
unset($WMpicture);
[2022] Fix | Delete
}
[2023] Fix | Delete
[2024] Fix | Delete
$thisObject['description_record'][$i] = $descriptionRecord;
[2025] Fix | Delete
}
[2026] Fix | Delete
break;
[2027] Fix | Delete
[2028] Fix | Delete
case GETID3_ASF_Index_Parameters_Object:
[2029] Fix | Delete
$thisObject['index_entry_time_interval'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4));
[2030] Fix | Delete
$offset += 4;
[2031] Fix | Delete
[2032] Fix | Delete
$thisObject['index_specifiers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2033] Fix | Delete
$offset += 2;
[2034] Fix | Delete
[2035] Fix | Delete
for ($i = 0; $i < $thisObject['index_specifiers_count']; $i++) {
[2036] Fix | Delete
$indexSpecifier = array();
[2037] Fix | Delete
[2038] Fix | Delete
$indexSpecifier['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2039] Fix | Delete
$offset += 2;
[2040] Fix | Delete
[2041] Fix | Delete
$indexSpecifier['index_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2042] Fix | Delete
$offset += 2;
[2043] Fix | Delete
$indexSpecifier['index_type_text'] = isset(static::$ASFIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']])
[2044] Fix | Delete
? static::$ASFIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']]
[2045] Fix | Delete
: 'invalid'
[2046] Fix | Delete
;
[2047] Fix | Delete
[2048] Fix | Delete
$thisObject['index_specifiers'][$i] = $indexSpecifier;
[2049] Fix | Delete
}
[2050] Fix | Delete
[2051] Fix | Delete
break;
[2052] Fix | Delete
[2053] Fix | Delete
case GETID3_ASF_Media_Object_Index_Parameters_Object:
[2054] Fix | Delete
$thisObject['index_entry_count_interval'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4));
[2055] Fix | Delete
$offset += 4;
[2056] Fix | Delete
[2057] Fix | Delete
$thisObject['index_specifiers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2058] Fix | Delete
$offset += 2;
[2059] Fix | Delete
[2060] Fix | Delete
for ($i = 0; $i < $thisObject['index_specifiers_count']; $i++) {
[2061] Fix | Delete
$indexSpecifier = array();
[2062] Fix | Delete
[2063] Fix | Delete
$indexSpecifier['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2064] Fix | Delete
$offset += 2;
[2065] Fix | Delete
[2066] Fix | Delete
$indexSpecifier['index_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2067] Fix | Delete
$offset += 2;
[2068] Fix | Delete
$indexSpecifier['index_type_text'] = isset(static::$ASFMediaObjectIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']])
[2069] Fix | Delete
? static::$ASFMediaObjectIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']]
[2070] Fix | Delete
: 'invalid'
[2071] Fix | Delete
;
[2072] Fix | Delete
[2073] Fix | Delete
$thisObject['index_specifiers'][$i] = $indexSpecifier;
[2074] Fix | Delete
}
[2075] Fix | Delete
[2076] Fix | Delete
break;
[2077] Fix | Delete
[2078] Fix | Delete
case GETID3_ASF_Timecode_Index_Parameters_Object:
[2079] Fix | Delete
// 4.11 Timecode Index Parameters Object (mandatory only if TIMECODE index is present in file, 0 or 1)
[2080] Fix | Delete
// Field name Field type Size (bits)
[2081] Fix | Delete
// Object ID GUID 128 // GUID for the Timecode Index Parameters Object - ASF_Timecode_Index_Parameters_Object
[2082] Fix | Delete
// Object Size QWORD 64 // Specifies the size, in bytes, of the Timecode Index Parameters Object. Valid values are at least 34 bytes.
[2083] Fix | Delete
// Index Entry Count Interval DWORD 32 // This value is ignored for the Timecode Index Parameters Object.
[2084] Fix | Delete
// Index Specifiers Count WORD 16 // Specifies the number of entries in the Index Specifiers list. Valid values are 1 and greater.
[2085] Fix | Delete
// Index Specifiers array of: varies //
[2086] Fix | Delete
// * Stream Number WORD 16 // Specifies the stream number that the Index Specifiers refer to. Valid values are between 1 and 127.
[2087] Fix | Delete
// * Index Type WORD 16 // Specifies the type of index. Values are defined as follows (1 is not a valid value):
[2088] Fix | Delete
// 2 = Nearest Past Media Object - indexes point to the closest data packet containing an entire video frame or the first fragment of a video frame
[2089] Fix | Delete
// 3 = Nearest Past Cleanpoint - indexes point to the closest data packet containing an entire video frame (or first fragment of a video frame) that is a key frame.
[2090] Fix | Delete
// Nearest Past Media Object is the most common value
[2091] Fix | Delete
[2092] Fix | Delete
$thisObject['index_entry_count_interval'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4));
[2093] Fix | Delete
$offset += 4;
[2094] Fix | Delete
[2095] Fix | Delete
$thisObject['index_specifiers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2096] Fix | Delete
$offset += 2;
[2097] Fix | Delete
[2098] Fix | Delete
for ($i = 0; $i < $thisObject['index_specifiers_count']; $i++) {
[2099] Fix | Delete
$indexSpecifier = array();
[2100] Fix | Delete
[2101] Fix | Delete
$indexSpecifier['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2102] Fix | Delete
$offset += 2;
[2103] Fix | Delete
[2104] Fix | Delete
$indexSpecifier['index_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
[2105] Fix | Delete
$offset += 2;
[2106] Fix | Delete
$indexSpecifier['index_type_text'] = isset(static::$ASFTimecodeIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']])
[2107] Fix | Delete
? static::$ASFTimecodeIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']]
[2108] Fix | Delete
: 'invalid'
[2109] Fix | Delete
;
[2110] Fix | Delete
[2111] Fix | Delete
$thisObject['index_specifiers'][$i] = $indexSpecifier;
[2112] Fix | Delete
}
[2113] Fix | Delete
[2114] Fix | Delete
break;
[2115] Fix | Delete
[2116] Fix | Delete
case GETID3_ASF_Compatibility_Object:
[2117] Fix | Delete
$thisObject['profile'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 1));
[2118] Fix | Delete
$offset += 1;
[2119] Fix | Delete
[2120] Fix | Delete
$thisObject['mode'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 1));
[2121] Fix | Delete
$offset += 1;
[2122] Fix | Delete
[2123] Fix | Delete
break;
[2124] Fix | Delete
[2125] Fix | Delete
default:
[2126] Fix | Delete
$unhandled_sections++;
[2127] Fix | Delete
if ($this->GUIDname($thisObject['guid_text'])) {
[2128] Fix | Delete
$this->warning('unhandled Header Extension Object GUID "'.$this->GUIDname($thisObject['guid_text']).'" {'.$thisObject['guid_text'].'} at offset '.($offset - 16 - 8));
[2129] Fix | Delete
} else {
[2130] Fix | Delete
$this->warning('unknown Header Extension Object GUID {'.$thisObject['guid_text'].'} in at offset '.($offset - 16 - 8));
[2131] Fix | Delete
}
[2132] Fix | Delete
break;
[2133] Fix | Delete
}
[2134] Fix | Delete
$HeaderExtensionObjectParsed[] = $thisObject;
[2135] Fix | Delete
[2136] Fix | Delete
$objectOffset += $thisObject['size'];
[2137] Fix | Delete
}
[2138] Fix | Delete
return $HeaderExtensionObjectParsed;
[2139] Fix | Delete
}
[2140] Fix | Delete
[2141] Fix | Delete
/**
[2142] Fix | Delete
* @param int $id
[2143] Fix | Delete
*
[2144] Fix | Delete
* @return string
[2145] Fix | Delete
*/
[2146] Fix | Delete
public static function metadataLibraryObjectDataTypeLookup($id) {
[2147] Fix | Delete
static $lookup = array(
[2148] Fix | Delete
0x0000 => 'Unicode string', // The data consists of a sequence of Unicode characters
[2149] Fix | Delete
0x0001 => 'BYTE array', // The type of the data is implementation-specific
[2150] Fix | Delete
0x0002 => 'BOOL', // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer. Only 0x0000 or 0x0001 are permitted values
[2151] Fix | Delete
0x0003 => 'DWORD', // The data is 4 bytes long and should be interpreted as a 32-bit unsigned integer
[2152] Fix | Delete
0x0004 => 'QWORD', // The data is 8 bytes long and should be interpreted as a 64-bit unsigned integer
[2153] Fix | Delete
0x0005 => 'WORD', // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer
[2154] Fix | Delete
0x0006 => 'GUID', // The data is 16 bytes long and should be interpreted as a 128-bit GUID
[2155] Fix | Delete
);
[2156] Fix | Delete
return (isset($lookup[$id]) ? $lookup[$id] : 'invalid');
[2157] Fix | Delete
}
[2158] Fix | Delete
[2159] Fix | Delete
/**
[2160] Fix | Delete
* @param string $data
[2161] Fix | Delete
*
[2162] Fix | Delete
* @return array
[2163] Fix | Delete
*/
[2164] Fix | Delete
public function ASF_WMpicture(&$data) {
[2165] Fix | Delete
//typedef struct _WMPicture{
[2166] Fix | Delete
// LPWSTR pwszMIMEType;
[2167] Fix | Delete
// BYTE bPictureType;
[2168] Fix | Delete
// LPWSTR pwszDescription;
[2169] Fix | Delete
// DWORD dwDataLen;
[2170] Fix | Delete
// BYTE* pbData;
[2171] Fix | Delete
//} WM_PICTURE;
[2172] Fix | Delete
[2173] Fix | Delete
$WMpicture = array();
[2174] Fix | Delete
[2175] Fix | Delete
$offset = 0;
[2176] Fix | Delete
$WMpicture['image_type_id'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 1));
[2177] Fix | Delete
$offset += 1;
[2178] Fix | Delete
$WMpicture['image_type'] = self::WMpictureTypeLookup($WMpicture['image_type_id']);
[2179] Fix | Delete
$WMpicture['image_size'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 4));
[2180] Fix | Delete
$offset += 4;
[2181] Fix | Delete
[2182] Fix | Delete
$WMpicture['image_mime'] = '';
[2183] Fix | Delete
do {
[2184] Fix | Delete
$next_byte_pair = substr($data, $offset, 2);
[2185] Fix | Delete
$offset += 2;
[2186] Fix | Delete
$WMpicture['image_mime'] .= $next_byte_pair;
[2187] Fix | Delete
} while ($next_byte_pair !== "\x00\x00");
[2188] Fix | Delete
[2189] Fix | Delete
$WMpicture['image_description'] = '';
[2190] Fix | Delete
do {
[2191] Fix | Delete
$next_byte_pair = substr($data, $offset, 2);
[2192] Fix | Delete
$offset += 2;
[2193] Fix | Delete
$WMpicture['image_description'] .= $next_byte_pair;
[2194] Fix | Delete
} while ($next_byte_pair !== "\x00\x00");
[2195] Fix | Delete
[2196] Fix | Delete
$WMpicture['dataoffset'] = $offset;
[2197] Fix | Delete
$WMpicture['data'] = substr($data, $offset);
[2198] Fix | Delete
[2199] Fix | Delete
$imageinfo = array();
[2200] Fix | Delete
$WMpicture['image_mime'] = '';
[2201] Fix | Delete
$imagechunkcheck = getid3_lib::GetDataImageSize($WMpicture['data'], $imageinfo);
[2202] Fix | Delete
unset($imageinfo);
[2203] Fix | Delete
if (!empty($imagechunkcheck)) {
[2204] Fix | Delete
$WMpicture['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]);
[2205] Fix | Delete
}
[2206] Fix | Delete
if (!isset($this->getid3->info['asf']['comments']['picture'])) {
[2207] Fix | Delete
$this->getid3->info['asf']['comments']['picture'] = array();
[2208] Fix | Delete
}
[2209] Fix | Delete
$this->getid3->info['asf']['comments']['picture'][] = array('data'=>$WMpicture['data'], 'image_mime'=>$WMpicture['image_mime']);
[2210] Fix | Delete
[2211] Fix | Delete
return $WMpicture;
[2212] Fix | Delete
}
[2213] Fix | Delete
[2214] Fix | Delete
/**
[2215] Fix | Delete
* Remove terminator 00 00 and convert UTF-16LE to Latin-1.
[2216] Fix | Delete
*
[2217] Fix | Delete
* @param string $string
[2218] Fix | Delete
*
[2219] Fix | Delete
* @return string
[2220] Fix | Delete
*/
[2221] Fix | Delete
public static function TrimConvert($string) {
[2222] Fix | Delete
return trim(getid3_lib::iconv_fallback('UTF-16LE', 'ISO-8859-1', self::TrimTerm($string)), ' ');
[2223] Fix | Delete
}
[2224] Fix | Delete
[2225] Fix | Delete
/**
[2226] Fix | Delete
* Remove terminator 00 00.
[2227] Fix | Delete
*
[2228] Fix | Delete
* @param string $string
[2229] Fix | Delete
*
[2230] Fix | Delete
* @return string
[2231] Fix | Delete
*/
[2232] Fix | Delete
public static function TrimTerm($string) {
[2233] Fix | Delete
// remove terminator, only if present (it should be, but...)
[2234] Fix | Delete
if (substr($string, -2) === "\x00\x00") {
[2235] Fix | Delete
$string = substr($string, 0, -2);
[2236] Fix | Delete
}
[2237] Fix | Delete
return $string;
[2238] Fix | Delete
}
[2239] Fix | Delete
[2240] Fix | Delete
}
[2241] Fix | Delete
[2242] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function