Spaces:
Paused
Paused
Update stream_server.py
Browse files- stream_server.py +3 -2
stream_server.py
CHANGED
@@ -125,9 +125,10 @@ async def add_video(video_name, output_path, audio_duration):
|
|
125 |
if remaining_segment_path not in existing_segments:
|
126 |
m3u8_file.write(f"#EXTINF:{remaining_duration:.3f},\n")
|
127 |
m3u8_file.write(f"{remaining_segment_path}\n")
|
|
|
128 |
|
129 |
-
# Add #EXT-X-ENDLIST only
|
130 |
-
if remaining_duration
|
131 |
with open(output_path, 'a') as m3u8_file:
|
132 |
m3u8_file.write("#EXT-X-ENDLIST\n")
|
133 |
|
|
|
125 |
if remaining_segment_path not in existing_segments:
|
126 |
m3u8_file.write(f"#EXTINF:{remaining_duration:.3f},\n")
|
127 |
m3u8_file.write(f"{remaining_segment_path}\n")
|
128 |
+
remaining_duration = 0
|
129 |
|
130 |
+
# Add #EXT-X-ENDLIST only once after all segments have been added
|
131 |
+
if remaining_duration == 0:
|
132 |
with open(output_path, 'a') as m3u8_file:
|
133 |
m3u8_file.write("#EXT-X-ENDLIST\n")
|
134 |
|