Skip to content

Commit

Permalink
Fix broken segment ready check
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaserlang committed Dec 13, 2023
1 parent 8e9305c commit f7c3ac7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions seplis_play_server/transcoders/hls.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ async def first_last_transcoded_segment(cls, transcode_folder: str):
m = re.search(r'(\d+)\.m4s', line)
if m:
last = int(m.group(1))
if not first:
if first < 1:
first = last
else:
logger.debug(f'No media file {f}')
return (first, last)

@classmethod
async def is_segment_ready(cls, transcode_folder: str, segment: int):
_, last_segment = await cls.first_last_transcoded_segment(transcode_folder)
return last_segment >= segment
first_segment, last_segment = await cls.first_last_transcoded_segment(transcode_folder)
return segment >= first_segment and segment <= last_segment

@staticmethod
def get_segment_path(transcode_folder: str, segment: int):
Expand Down

0 comments on commit f7c3ac7

Please sign in to comment.