Code Duplication    Length = 8-19 lines in 2 locations

3rdparty/getID3/getid3/module.audio-video.quicktime.php 2 locations

@@ 1006-1024 (lines=19) @@
1003
					if ($max_stts_entries_to_scan < $atom_structure['number_entries']) {
1004
						$this->warning('QuickTime atom "stts" has '.$atom_structure['number_entries'].' but only scanning the first '.$max_stts_entries_to_scan.' entries due to limited PHP memory available ('.floor($this->getid3->memory_limit / 1048576).'MB).');
1005
					}
1006
					for ($i = 0; $i < $max_stts_entries_to_scan; $i++) {
1007
						$atom_structure['time_to_sample_table'][$i]['sample_count']    = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
1008
						$sttsEntriesDataOffset += 4;
1009
						$atom_structure['time_to_sample_table'][$i]['sample_duration'] = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
1010
						$sttsEntriesDataOffset += 4;
1011
1012
						$frames_count += $atom_structure['time_to_sample_table'][$i]['sample_count'];
1013
1014
						// THIS SECTION REPLACED WITH CODE IN "stbl" ATOM
1015
						//if (!empty($info['quicktime']['time_scale']) && ($atom_structure['time_to_sample_table'][$i]['sample_duration'] > 0)) {
1016
						//	$stts_new_framerate = $info['quicktime']['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'];
1017
						//	if ($stts_new_framerate <= 60) {
1018
						//		// some atoms have durations of "1" giving a very large framerate, which probably is not right
1019
						//		$info['video']['frame_rate'] = max($info['video']['frame_rate'], $stts_new_framerate);
1020
						//	}
1021
						//}
1022
						//
1023
						//$FrameRateCalculatorArray[($info['quicktime']['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'])] += $atom_structure['time_to_sample_table'][$i]['sample_count'];
1024
					}
1025
					$info['quicktime']['stts_framecount'][] = $frames_count;
1026
					//$sttsFramesTotal  = 0;
1027
					//$sttsSecondsTotal = 0;
@@ 1440-1447 (lines=8) @@
1437
					$offset += 1;
1438
1439
					$atom_structure['num_iods_tracks'] = ($atom_structure['length'] - 7) / 6; // 6 bytes would only be right if all tracks use 1-byte length fields
1440
					for ($i = 0; $i < $atom_structure['num_iods_tracks']; $i++) {
1441
						$atom_structure['track'][$i]['ES_ID_IncTag'] =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
1442
						$offset += 1;
1443
						$atom_structure['track'][$i]['length']       = $this->quicktime_read_mp4_descr_length($atom_data, $offset);
1444
						//$offset already adjusted by quicktime_read_mp4_descr_length()
1445
						$atom_structure['track'][$i]['track_id']     =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 4));
1446
						$offset += 4;
1447
					}
1448
1449
					$atom_structure['audio_profile_name'] = $this->QuicktimeIODSaudioProfileName($atom_structure['audio_profile_id']);
1450
					$atom_structure['video_profile_name'] = $this->QuicktimeIODSvideoProfileName($atom_structure['video_profile_id']);