예제 #1
0
파일: m4a.py 프로젝트: matttbe/foobnix
 def __update_parents(self, fileobj, path, delta, offset):
     # Update all parent atoms with the new size.
     for atom in path:
         fileobj.seek(atom.offset + offset)
         size = cdata.uint_be(fileobj.read(4)) + delta
         fileobj.seek(atom.offset + offset)
         fileobj.write(cdata.to_uint_be(size))
예제 #2
0
파일: m4a.py 프로젝트: inferno1988/foobnix
 def __update_parents(self, fileobj, path, delta, offset):
     # Update all parent atoms with the new size.
     for atom in path:
         fileobj.seek(atom.offset + offset)
         size = cdata.uint_be(fileobj.read(4)) + delta
         fileobj.seek(atom.offset + offset)
         fileobj.write(cdata.to_uint_be(size))
예제 #3
0
파일: mp4.py 프로젝트: matttbe/foobnix
 def __update_parents(self, fileobj, path, delta):
     """Update all parent atoms with the new size."""
     for atom in path:
         fileobj.seek(atom.offset)
         size = cdata.uint_be(fileobj.read(4))
         if size == 1: # 64bit
             # skip name (4B) and read size (8B)
             size = cdata.ulonglong_be(fileobj.read(12)[4:])
             fileobj.seek(atom.offset + 8)
             fileobj.write(cdata.to_ulonglong_be(size + delta))
         else: # 32bit
             fileobj.seek(atom.offset)
             fileobj.write(cdata.to_uint_be(size + delta))
예제 #4
0
파일: mp4.py 프로젝트: atis/foobnix
 def __update_parents(self, fileobj, path, delta):
     """Update all parent atoms with the new size."""
     for atom in path:
         fileobj.seek(atom.offset)
         size = cdata.uint_be(fileobj.read(4))
         if size == 1:  # 64bit
             # skip name (4B) and read size (8B)
             size = cdata.ulonglong_be(fileobj.read(12)[4:])
             fileobj.seek(atom.offset + 8)
             fileobj.write(cdata.to_ulonglong_be(size + delta))
         else:  # 32bit
             fileobj.seek(atom.offset)
             fileobj.write(cdata.to_uint_be(size + delta))