@@ -473,6 +473,9 @@ public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset
473473 } else {
474474 // Apple item list box atom handler
475475 $ atomoffset = 0 ;
476+ // todo (2025-10-16): 0x10B5 is probably Packed ISO639-2/T language code so this code block is likely incorrect
477+ // need to locate sample file to figure out what is going on here and why this code was written as such
478+ // https://developer.apple.com/documentation/quicktime-file-format/language_code_values
476479 if (substr ($ atom_data , 2 , 2 ) == "\x10\xB5" ) {
477480 // not sure what it means, but observed on iPhone4 data.
478481 // Each $atom_data has 2 bytes of datasize, plus 0x10B5, then data
@@ -1754,17 +1757,20 @@ public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset
17541757 break ;
17551758
17561759 case 'data ' : // metaDATA atom
1757- // seems to be 2 bytes language code (ASCII), 2 bytes unknown (set to 0x10B5 in one sample I have; 0x15C7 in another ), remainder is useful data
1758- $ atom_structure ['language ' ] = substr ($ atom_data , 4 + 0 , 2 );
1759- $ atom_structure ['unknown ' ] = getid3_lib::BigEndian2Int (substr ($ atom_data , 4 + 2 , 2 ));
1760- $ atom_structure ['data ' ] = substr ($ atom_data , 4 + 4 );
1760+ // seems to be 2 bytes language code (ASCII), 2 bytes language code (probably packed ISO639-2/T ), remainder is useful data
1761+ $ atom_structure ['lang2 ' ] = substr ($ atom_data , 4 + 0 , 2 );
1762+ $ atom_structure ['lang3 ' ] = $ this -> QuicktimeLanguageLookup ( getid3_lib::BigEndian2Int (substr ($ atom_data , 4 + 2 , 2 ) ));
1763+ $ atom_structure ['data ' ] = substr ($ atom_data , 4 + 4 );
17611764 $ atom_structure ['key_name ' ] = (isset ($ info ['quicktime ' ]['temp_meta_key_names ' ][$ this ->metaDATAkey ]) ? $ info ['quicktime ' ]['temp_meta_key_names ' ][$ this ->metaDATAkey ] : '' );
17621765 $ this ->metaDATAkey ++;
17631766
17641767 switch ($ atom_structure ['key_name ' ]) {
17651768 case 'com.android.capture.fps ' :
17661769 $ atom_structure ['data ' ] = getid3_lib::BigEndian2Float ($ atom_structure ['data ' ]);
17671770 break ;
1771+ case 'com.apple.quicktime.camera.focal_length.35mm_equivalent ' :
1772+ $ atom_structure ['data ' ] = getid3_lib::BigEndian2Int ($ atom_structure ['data ' ]);
1773+ break ;
17681774 }
17691775
17701776 if ($ atom_structure ['key_name ' ] && $ atom_structure ['data ' ]) {
@@ -2363,6 +2369,7 @@ public function quicktime_read_mp4_descr_length($data, &$offset) {
23632369 */
23642370 public function QuicktimeLanguageLookup ($ languageid ) {
23652371 // http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353
2372+ // https://developer.apple.com/documentation/quicktime-file-format/language_code_values
23662373 static $ QuicktimeLanguageLookup = array ();
23672374 if (empty ($ QuicktimeLanguageLookup )) {
23682375 $ QuicktimeLanguageLookup [0 ] = 'English ' ;
0 commit comments