Changeset 41196 for trunk/src/wp-includes/ID3/module.audio.ogg.php
- Timestamp:
- 07/31/2017 07:49:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/module.audio.ogg.php
r32979 r41196 27 27 // Warn about illegal tags - only vorbiscomments are allowed 28 28 if (isset($info['id3v2'])) { 29 $ info['warning'][] = 'Illegal ID3v2 tag present.';29 $this->warning('Illegal ID3v2 tag present.'); 30 30 } 31 31 if (isset($info['id3v1'])) { 32 $ info['warning'][] = 'Illegal ID3v1 tag present.';32 $this->warning('Illegal ID3v1 tag present.'); 33 33 } 34 34 if (isset($info['ape'])) { 35 $ info['warning'][] = 'Illegal APE tag present.';35 $this->warning('Illegal APE tag present.'); 36 36 } 37 37 … … 45 45 46 46 if ($this->ftell() >= $this->getid3->fread_buffer_size()) { 47 $ info['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?)';47 $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?)'); 48 48 unset($info['fileformat']); 49 49 unset($info['ogg']); … … 180 180 $info['video']['pixel_aspect_ratio'] = (float) $info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] / $info['ogg']['pageheader']['theora']['pixel_aspect_denominator']; 181 181 } 182 $ info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of getID3 ['.$this->getid3->version().'] -- bitrate, playtime and all audio data are currently unavailable';182 $this->warning('Ogg Theora (v3) not fully supported in this version of getID3 ['.$this->getid3->version().'] -- bitrate, playtime and all audio data are currently unavailable'); 183 183 184 184 … … 241 241 242 242 $info['video']['dataformat'] = 'theora1'; 243 $ info['error'][] = 'Ogg Theora (v1) not correctly handled in this version of getID3 ['.$this->getid3->version().']';243 $this->error('Ogg Theora (v1) not correctly handled in this version of getID3 ['.$this->getid3->version().']'); 244 244 //break; 245 245 … … 249 249 250 250 } else { 251 $ info['error'][] = 'unexpected';251 $this->error('unexpected'); 252 252 //break; 253 253 } … … 257 257 $this->fseek($oggpageinfo['page_start_offset']); 258 258 259 $ info['error'][] = 'Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']';259 $this->error('Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']'); 260 260 //return false; 261 261 262 262 } else { 263 263 264 $ info['error'][] = 'Expecting either "Speex ", "OpusHead" or "vorbis" identifier strings, found "'.substr($filedata, 0, 8).'"';264 $this->error('Expecting either "Speex ", "OpusHead" or "vorbis" identifier strings, found "'.substr($filedata, 0, 8).'"'); 265 265 unset($info['ogg']); 266 266 unset($info['mime_type']); … … 285 285 $flac = new getid3_flac($this->getid3); 286 286 if (!$flac->parseMETAdata()) { 287 $ info['error'][] = 'Failed to parse FLAC headers';287 $this->error('Failed to parse FLAC headers'); 288 288 return false; 289 289 } … … 300 300 $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, 0, 8); // hard-coded to 'OpusTags' 301 301 if(substr($filedata, 0, 8) != 'OpusTags') { 302 $ info['error'][] = 'Expected "OpusTags" as header but got "'.substr($filedata, 0, 8).'"';302 $this->error('Expected "OpusTags" as header but got "'.substr($filedata, 0, 8).'"'); 303 303 return false; 304 304 } … … 312 312 if (!getid3_lib::intValueSupported($info['avdataend'])) { 313 313 314 $ info['warning'][] = 'Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)';314 $this->warning('Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)'); 315 315 316 316 } else { … … 324 324 $info['ogg']['samples'] = $info['ogg']['pageheader']['eos']['pcm_abs_position']; 325 325 if ($info['ogg']['samples'] == 0) { 326 $ info['error'][] = 'Corrupt Ogg file: eos.number of samples == zero';326 $this->error('Corrupt Ogg file: eos.number of samples == zero'); 327 327 return false; 328 328 } … … 343 343 if (isset($info['audio']['bitrate']) && !isset($info['playtime_seconds'])) { 344 344 if ($info['audio']['bitrate'] == 0) { 345 $ info['error'][] = 'Corrupt Ogg file: bitrate_audio == zero';345 $this->error('Corrupt Ogg file: bitrate_audio == zero'); 346 346 return false; 347 347 } … … 396 396 $filedataoffset += 4; 397 397 if ($info['ogg']['samplerate'] == 0) { 398 $ info['error'][] = 'Corrupt Ogg file: sample rate == zero';398 $this->error('Corrupt Ogg file: sample rate == zero'); 399 399 return false; 400 400 } … … 444 444 445 445 if ($info['ogg']['pageheader']['opus']['version'] < 1 || $info['ogg']['pageheader']['opus']['version'] > 15) { 446 $ info['error'][] = 'Unknown opus version number (only accepting 1-15)';446 $this->error('Unknown opus version number (only accepting 1-15)'); 447 447 return false; 448 448 } … … 452 452 453 453 if ($info['ogg']['pageheader']['opus']['out_channel_count'] == 0) { 454 $ info['error'][] = 'Invalid channel count in opus header (must not be zero)';454 $this->error('Invalid channel count in opus header (must not be zero)'); 455 455 return false; 456 456 } … … 563 563 default: 564 564 return false; 565 break; 565 566 } 566 567 … … 581 582 if ($i >= 10000) { 582 583 // https://github.com/owncloud/music/issues/212#issuecomment-43082336 583 $ info['warning'][] = 'Unexpectedly large number ('.$CommentsCount.') of Ogg comments - breaking after reading '.$i.' comments';584 $this->warning('Unexpectedly large number ('.$CommentsCount.') of Ogg comments - breaking after reading '.$i.' comments'); 584 585 break; 585 586 } … … 619 620 while ((strlen($commentdata) - $commentdataoffset) < $ThisFileInfo_ogg_comments_raw[$i]['size']) { 620 621 if (($ThisFileInfo_ogg_comments_raw[$i]['size'] > $info['avdataend']) || ($ThisFileInfo_ogg_comments_raw[$i]['size'] < 0)) { 621 $ info['warning'][] = 'Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($ThisFileInfo_ogg_comments_raw[$i]['size']).' bytes) - aborting reading comments';622 $this->warning('Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($ThisFileInfo_ogg_comments_raw[$i]['size']).' bytes) - aborting reading comments'); 622 623 break 2; 623 624 } … … 643 644 //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); 644 645 if (!isset($info['ogg']['pageheader'][$VorbisCommentPage])) { 645 $ info['warning'][] = 'undefined Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell();646 $this->warning('undefined Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell()); 646 647 break; 647 648 } 648 649 $readlength = self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1); 649 650 if ($readlength <= 0) { 650 $ info['warning'][] = 'invalid length Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell();651 $this->warning('invalid length Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell()); 651 652 break; 652 653 } … … 662 663 663 664 // no comment? 664 $ info['warning'][] = 'Blank Ogg comment ['.$i.']';665 $this->warning('Blank Ogg comment ['.$i.']'); 665 666 666 667 } elseif (strstr($commentstring, '=')) { … … 712 713 } else { 713 714 714 $ info['warning'][] = '[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$commentstring;715 $this->warning('[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$commentstring); 715 716 716 717 }
Note: See TracChangeset
for help on using the changeset viewer.