Fixed bext parsing for metacorder

These have really screwed-up bext chunks that aren't zero-filled.
This commit is contained in:
Jamie Hardt
2019-01-01 19:30:43 -08:00
parent d37726f090
commit ae09897abf
3 changed files with 81 additions and 133 deletions

View File

@@ -29,7 +29,7 @@ class TestWaveInfo(TestCase):
for dirpath, dirnames, filenames in os.walk('tests/test_files'):
for filename in filenames:
name, ext = os.path.splitext(filename)
if ext == '.wav':
if ext in ['.wav','.WAV']:
yield os.path.join(dirpath, filename)
@@ -68,13 +68,23 @@ class TestWaveInfo(TestCase):
self.assertEqual( info.bext.description, ffprobe_info['format']['tags']['comment'] )
self.assertEqual( info.bext.originator, ffprobe_info['format']['tags']['encoded_by'] )
self.assertEqual( info.bext.originator_ref, ffprobe_info['format']['tags']['originator_reference'] )
if 'originator_reference' in ffprobe_info['format']['tags']:
self.assertEqual( info.bext.originator_ref, ffprobe_info['format']['tags']['originator_reference'] )
else:
self.assertEqual( info.bext.originator_ref, None)
# these don't always reflect the bext info
#self.assertEqual( info.bext.originator_date, ffprobe_info['format']['tags']['date'] )
#self.assertEqual( info.bext.originator_time, ffprobe_info['format']['tags']['creation_time'] )
self.assertEqual( info.bext.time_reference, int(ffprobe_info['format']['tags']['time_reference']) )
self.assertEqual( info.bext.coding_history, ffprobe_info['format']['tags']['coding_history'] )
if 'coding_history' in ffprobe_info['format']['tags']:
if len(ffprobe_info['format']['tags']['coding_history']) > 0:
self.assertEqual( info.bext.coding_history, ffprobe_info['format']['tags']['coding_history'] )
else:
self.assertEqual( info.bext.coding_history, None )
else:
self.assertEqual( info.bext.coding_history, None )
def test_ixml(self):
expected = {'A101_4.WAV': {'project' : 'BMH', 'scene': 'A101', 'take': '4',