Allow bounded playback to buffer ahead of the browser

This commit is contained in:
Codex
2026-10-06 23:08:40 +08:00
parent f7d3fea92f
commit d8826152c6
8 changed files with 13 additions and 8 deletions
+2 -2
View File
@@ -53,10 +53,10 @@ class PlaybackCacheTests(unittest.TestCase):
self.assertEqual((fresh/'source.mp4').read_bytes(),b'active')
self.assertEqual(unrelated.read_text(),'keep')
def test_local_converter_is_paced_and_has_no_credentials(self):
def test_local_converter_can_buffer_ahead_and_has_no_credentials(self):
with patch('playback.shutil.which', return_value='ffmpeg'), patch('playback.os.access', return_value=False):
cmd=playback.command('/tmp/private/source.mp4', '', 300)
self.assertIn('-readrate', cmd)
self.assertNotIn('-readrate', cmd)
self.assertNotIn('-headers', cmd)
self.assertIn('libx264', cmd)
self.assertEqual(cmd[cmd.index('-threads')+1], '1')