Code Duplication    Length = 8-19 lines in 2 locations

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

@@ 980-998 (lines=19) @@
977
					if ($max_stts_entries_to_scan < $atom_structure['number_entries']) {
978
						$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).');
979
					}
980
					for ($i = 0; $i < $max_stts_entries_to_scan; $i++) {
981
						$atom_structure['time_to_sample_table'][$i]['sample_count']    = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
982
						$sttsEntriesDataOffset += 4;
983
						$atom_structure['time_to_sample_table'][$i]['sample_duration'] = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
984
						$sttsEntriesDataOffset += 4;
985
986
						$frames_count += $atom_structure['time_to_sample_table'][$i]['sample_count'];
987
988
						// THIS SECTION REPLACED WITH CODE IN "stbl" ATOM
989
						//if (!empty($info['quicktime']['time_scale']) && ($atom_structure['time_to_sample_table'][$i]['sample_duration'] > 0)) {
990
						//	$stts_new_framerate = $info['quicktime']['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'];
991
						//	if ($stts_new_framerate <= 60) {
992
						//		// some atoms have durations of "1" giving a very large framerate, which probably is not right
993
						//		$info['video']['frame_rate'] = max($info['video']['frame_rate'], $stts_new_framerate);
994
						//	}
995
						//}
996
						//
997
						//$FrameRateCalculatorArray[($info['quicktime']['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'])] += $atom_structure['time_to_sample_table'][$i]['sample_count'];
998
					}
999
					$info['quicktime']['stts_framecount'][] = $frames_count;
1000
					//$sttsFramesTotal  = 0;
1001
					//$sttsSecondsTotal = 0;
@@ 1414-1421 (lines=8) @@
1411
					$offset += 1;
1412
1413
					$atom_structure['num_iods_tracks'] = ($atom_structure['length'] - 7) / 6; // 6 bytes would only be right if all tracks use 1-byte length fields
1414
					for ($i = 0; $i < $atom_structure['num_iods_tracks']; $i++) {
1415
						$atom_structure['track'][$i]['ES_ID_IncTag'] =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
1416
						$offset += 1;
1417
						$atom_structure['track'][$i]['length']       = $this->quicktime_read_mp4_descr_length($atom_data, $offset);
1418
						//$offset already adjusted by quicktime_read_mp4_descr_length()
1419
						$atom_structure['track'][$i]['track_id']     =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 4));
1420
						$offset += 4;
1421
					}
1422
1423
					$atom_structure['audio_profile_name'] = $this->QuicktimeIODSaudioProfileName($atom_structure['audio_profile_id']);
1424
					$atom_structure['video_profile_name'] = $this->QuicktimeIODSvideoProfileName($atom_structure['video_profile_id']);