isDependencyFor example

if (isset($entry[$picture_key])) {
                            $comments_picture_data[$picture_key] = $entry[$picture_key];
                        }
                    }
                    $info['flac']['comments']['picture'][] = $comments_picture_data;
                    unset($comments_picture_data);
                }
            }
        }

        if (isset($info['flac']['STREAMINFO'])) {
            if (!$this->isDependencyFor('matroska')) {
                $info['flac']['compressed_audio_bytes'] = $info['avdataend'] - $info['avdataoffset'];
            }
            $info['flac']['uncompressed_audio_bytes'] = $info['flac']['STREAMINFO']['samples_stream'] * $info['flac']['STREAMINFO']['channels'] * ($info['flac']['STREAMINFO']['bits_per_sample'] / 8);
            if ($info['flac']['uncompressed_audio_bytes'] == 0) {
                return $this->error('Corrupt FLAC file: uncompressed_audio_bytes == zero');
            }
            if (!empty($info['flac']['compressed_audio_bytes'])) {
                $info['flac']['compression_ratio'] = $info['flac']['compressed_audio_bytes'] / $info['flac']['uncompressed_audio_bytes'];
            }
        }

        
if ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') {
                        $this->warning('VBR file with no VBR header. Bitrate values calculated from actual frame bitrates.');
                    }
                }

            }

        }

        if (($ExpectedNumberOfAudioBytes > 0) && ($ExpectedNumberOfAudioBytes != ($info['avdataend'] - $info['avdataoffset']))) {
            if ($ExpectedNumberOfAudioBytes > ($info['avdataend'] - $info['avdataoffset'])) {
                if ($this->isDependencyFor('matroska') || $this->isDependencyFor('riff')) {
                    // ignore, audio data is broken into chunks so will always be data "missing"                 }
                elseif (($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])) == 1) {
                    $this->warning('Last byte of data truncated (this is a known bug in Meracl ID3 Tag Writer before v1.3.5)');
                }
                else {
                    $this->warning('Probable truncated file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' (short by '.($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])).' bytes)');
                }
            } else {
                if ((($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes) == 1) {
                // $prenullbytefileoffset = $this->ftell();
        // 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']).'"');
            }
        }

        $info['audio']['dataformat']   = 'ac3';
        $info['audio']['bitrate_mode'] = 'cbr';
        $info['audio']['lossless']     = false;

        if ($thisfile_ac3_raw_bsi['bsid'] <= 8) {

            
$this->fseek($info['avdataoffset']);
        $DTSheader = $this->fread(20); // we only need 2 words magic + 6 words frame header, but these words may be normal 16-bit words OR 14-bit words with 2 highest bits set to zero, so 8 words can be either 8*16/8 = 16 bytes OR 8*16*(16/14)/8 = 18.3 bytes
        // check syncword         $sync = substr($DTSheader, 0, 4);
        if (($encoding = array_search($sync, self::$syncwords)) !== false) {

            $info['dts']['raw']['magic'] = $sync;
            $this->readBinDataOffset = 32;

        } elseif ($this->isDependencyFor('matroska')) {

            // Matroska contains DTS without syncword encoded as raw big-endian format             $encoding = 0;
            $this->readBinDataOffset = 0;

        } else {

            unset($info['fileformat']);
            return $this->error('Expecting "'.implode('| ', array_map('getid3_lib::PrintHexBytes', self::$syncwords)).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($sync).'"');

        }

        
Home | Imprint | This part of the site doesn't use cookies.