Skip to content
Permalink
Browse files

bugfix: #2066 Quicktime/AAC audio-only video key

Remove [video] key from returned structure if file only contains audio.
http://www.getid3.org/phpBB3/viewtopic.php?t=2066
  • Loading branch information...
JamesHeinrich committed Aug 15, 2017
1 parent b4194e7 commit 1fb459fe7d377eed79ce8549615383c5636e941d
Showing with 7 additions and 4 deletions.
  1. +7 −4 getid3/module.audio-video.quicktime.php
@@ -193,6 +193,9 @@ public function Analyze() {
if (empty($info['video']['dataformat']) && !empty($info['quicktime']['video'])) {
$info['video']['dataformat'] = 'quicktime';
}
if (isset($info['video']) && ($info['mime_type'] == 'audio/mp4') && empty($info['video']['resolution_x']) && empty($info['video']['resolution_y'])) {
unset($info['video']);
}
return true;
}
@@ -1695,7 +1698,7 @@ public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset
$this->warning('QuickTime atom "'.$atomname.'" is zero bytes long at offset '.$baseoffset);
}
break;
case 'loci':// 3GP location (El Loco)
$info['quicktime']['comments']['gps_flags'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4));
$info['quicktime']['comments']['gps_lang'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 2));
@@ -1709,7 +1712,7 @@ public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset
$info['quicktime']['comments']['gps_body'] = $this->LociString(substr($loci_data, 13), $loffset);
$info['quicktime']['comments']['gps_notes'] = $this->LociString(substr($loci_data, 13 + $loffset), $loffset);
break;
default:
$this->warning('Unknown QuickTime atom type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" ('.trim(getid3_lib::PrintHexBytes($atomname)).') at offset '.$baseoffset);
$atom_structure['data'] = $atom_data;
@@ -2571,10 +2574,10 @@ public function LociString($lstring, &$count) {
}else {
return '';
}
}
}
public function NoNullString($nullterminatedstring) {
// remove the single null terminator on null terminated strings
if (substr($nullterminatedstring, strlen($nullterminatedstring) - 1, 1) === "\x00") {

0 comments on commit 1fb459f

Please sign in to comment.
You can’t perform that action at this time.