cleanup
This commit is contained in:
parent
e8c5ea70e7
commit
facaa4144a
10
ffplayout.py
10
ffplayout.py
@ -277,8 +277,7 @@ def check_sync(begin, buffer):
|
|||||||
time_now = get_time('full_sec')
|
time_now = get_time('full_sec')
|
||||||
|
|
||||||
# around 2.5 seconds is in ffmpeg buffer
|
# around 2.5 seconds is in ffmpeg buffer
|
||||||
# TODO: more tests for a good value
|
tolerance = 7
|
||||||
tolerance = 40
|
|
||||||
|
|
||||||
time_distance = begin - time_now
|
time_distance = begin - time_now
|
||||||
if 0 <= time_now < _playlist.start and not begin == _playlist.start:
|
if 0 <= time_now < _playlist.start and not begin == _playlist.start:
|
||||||
@ -911,6 +910,9 @@ def play_clips(buffer, GetSourceIter):
|
|||||||
stdout=PIPE
|
stdout=PIPE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 65536 is the linux pipe buffer size,
|
||||||
|
# but this number is not divisible by 188 (the mpeg-ts packet size)
|
||||||
|
# so we take the next smaller number 65424 for reading
|
||||||
while True:
|
while True:
|
||||||
data = decoder.stdout.read(65424)
|
data = decoder.stdout.read(65424)
|
||||||
if not data:
|
if not data:
|
||||||
@ -932,7 +934,6 @@ def main():
|
|||||||
year = get_date(False).split('-')[0]
|
year = get_date(False).split('-')[0]
|
||||||
|
|
||||||
# the Queue connects pre- and post- compression
|
# the Queue connects pre- and post- compression
|
||||||
# TODO: have an eye on maxsize
|
|
||||||
buffer = Queue(maxsize=56)
|
buffer = Queue(maxsize=56)
|
||||||
try:
|
try:
|
||||||
if _playout.preview:
|
if _playout.preview:
|
||||||
@ -976,8 +977,7 @@ def main():
|
|||||||
play_thread.daemon = True
|
play_thread.daemon = True
|
||||||
play_thread.start()
|
play_thread.start()
|
||||||
|
|
||||||
# TODO: this needs to be changed,
|
# get data from Queue and write them to post process
|
||||||
# while True is bad, it needs a check to be able to exit
|
|
||||||
while True:
|
while True:
|
||||||
data = buffer.get()
|
data = buffer.get()
|
||||||
if not data:
|
if not data:
|
||||||
|
Loading…
Reference in New Issue
Block a user