Skip to content
Snippets Groups Projects
Commit 33f41ada authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

put back TYPE_DEF, TYPE_BINDING, and PRAGMA in python decoder

parent 3d74e0ce
No related branches found
No related tags found
No related merge requests found
......@@ -157,6 +157,8 @@ DEFAULT_VERSION = "LabComm2014"
i_VERSION = 0x01
i_SAMPLE_DEF = 0x02
i_SAMPLE_REF = 0x03
i_TYPE_DEF = 0x04
i_TYPE_BINDING= 0x05
i_PRAGMA = 0x3f
i_USER = 0x40 # ..0xffffffff
......@@ -829,6 +831,13 @@ class Decoder(Codec):
for _ in xrange(length):
self.decode_byte()
# kludge, should really check if the index exists in self.version
def skip_or_raise(self, length, index):
if usePacketLength(self.version):
self.skip(length)
else:
raise Exception("Invalid type index %d" % index)
def decode(self):
while True:
index = self.decode_type_number()
......@@ -847,6 +856,18 @@ class Decoder(Codec):
elif index == i_SAMPLE_REF:
decl = self.index_to_decl[index].decode_decl(self)
value = None
elif index == i_TYPE_DEF:
self.skip_or_raise(length, index)
decl = None
value = None
elif index == i_TYPE_BINDING:
self.skip_or_raise(length, index)
decl = None
value = None
elif index == i_PRAGMA:
self.skip_or_raise(length, index)
decl = None
value = None
elif index < i_USER:
raise Exception("Invalid type index %d" % index)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment