fread_buffer_size example


        }
    }

    /** * @param int $min_data * * @return bool */
    private function EnsureBufferHasEnoughData($min_data=1024) {
        if (($this->current_offset - $this->EBMLbuffer_offset) >= ($this->EBMLbuffer_length - $min_data)) {
            $read_bytes = max($min_data$this->getid3->fread_buffer_size());

            try {
                $this->fseek($this->current_offset);
                $this->EBMLbuffer_offset = $this->current_offset;
                $this->EBMLbuffer        = $this->fread($read_bytes);
                $this->EBMLbuffer_length = strlen($this->EBMLbuffer);
            } catch (getid3_exception $e) {
                $this->warning('EBML parser: '.$e->getMessage());
                return false;
            }

            
$this->warning('Illegal APE tag present.');
        }


        // Page 1 - Stream Header
        $this->fseek($info['avdataoffset']);

        $oggpageinfo = $this->ParseOggPageHeader();
        $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;

        if ($this->ftell() >= $this->getid3->fread_buffer_size()) {
            $this->error('Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)');
            unset($info['fileformat']);
            unset($info['ogg']);
            return false;
        }

        $filedata = $this->fread($oggpageinfo['page_length']);
        $filedataoffset = 0;

        if (substr($filedata, 0, 4) == 'fLaC') {

            
                    throw new Exception('supplied path ('.$dir.') does not exist, or is not writable');
                }
                $dest = $dir.DIRECTORY_SEPARATOR.$name.($image_mime ? '.'.getid3_lib::ImageExtFromMime($image_mime) : '');

                // create dest file                 if (($fp_dest = fopen($dest, 'wb')) == false) {
                    throw new Exception('failed to create file '.$dest);
                }

                // copy data                 $this->fseek($offset);
                $buffersize = ($this->data_string_flag ? $length : $this->getid3->fread_buffer_size());
                $bytesleft = $length;
                while ($bytesleft > 0) {
                    if (($buffer = $this->fread(min($buffersize$bytesleft))) === false || ($byteswritten = fwrite($fp_dest$buffer)) === false || ($byteswritten === 0)) {
                        throw new Exception($buffer === false ? 'not enough data to read' : 'failed to write to destination file, may be not enough disk space');
                    }
                    $bytesleft -= $byteswritten;
                }

                fclose($fp_dest);
                $attachment = $dest;

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