Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
moonsikpark committed Jul 18, 2024
1 parent d70b66a commit 9bb5b73
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_subtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,15 @@ def test_vobsub(self):
bms = sub.planes
self.assertEqual(len(bms), 1)
self.assertEqual(len(memoryview(bms[0])), 4800)

def test_subtitle_flush(self) -> None:
path = fate_suite("sub/MovText_capability_tester.mp4")

subs = []
with av.open(path) as container:
stream = container.streams.subtitles[0]
for packet in container.demux(stream):
subs.extend(stream.decode(packet))
subs.extend(stream.decode())

self.assertEqual(len(subs), 3)

0 comments on commit 9bb5b73

Please sign in to comment.