forked from DRMTalks/devine
Mark track as stopping when skipping segments
This commit is contained in:
parent
b482f86bb3
commit
f4ad7a2e6c
|
@ -524,9 +524,6 @@ class DASH:
|
|||
download_size = download.result()
|
||||
except KeyboardInterrupt:
|
||||
stop_event.set()
|
||||
if not has_stopped:
|
||||
has_stopped = True
|
||||
progress(downloaded="[orange]STOPPING")
|
||||
except Exception as e:
|
||||
stop_event.set()
|
||||
if has_stopped:
|
||||
|
@ -537,10 +534,14 @@ class DASH:
|
|||
progress(downloaded="[red]FAILING")
|
||||
traceback.print_exception(e)
|
||||
log.error(f"Segment Download worker threw an unhandled exception: {e!r}")
|
||||
else:
|
||||
if stop_event.is_set():
|
||||
# skipped
|
||||
continue
|
||||
|
||||
if stop_event.is_set():
|
||||
if not has_stopped:
|
||||
has_stopped = True
|
||||
progress(downloaded="[orange]STOPPING")
|
||||
continue
|
||||
|
||||
progress(advance=1)
|
||||
|
||||
now = time.time()
|
||||
|
|
|
@ -364,9 +364,6 @@ class HLS:
|
|||
download_size = download.result()
|
||||
except KeyboardInterrupt:
|
||||
stop_event.set()
|
||||
if not has_stopped:
|
||||
has_stopped = True
|
||||
progress(downloaded="[orange]STOPPING")
|
||||
except Exception as e:
|
||||
stop_event.set()
|
||||
if has_stopped:
|
||||
|
@ -377,10 +374,14 @@ class HLS:
|
|||
progress(downloaded="[red]FAILING")
|
||||
traceback.print_exception(e)
|
||||
log.error(f"Segment Download worker threw an unhandled exception: {e!r}")
|
||||
else:
|
||||
if stop_event.is_set():
|
||||
# skipped
|
||||
continue
|
||||
|
||||
if stop_event.is_set():
|
||||
if not has_stopped:
|
||||
has_stopped = True
|
||||
progress(downloaded="[orange]STOPPING")
|
||||
continue
|
||||
|
||||
progress(advance=1)
|
||||
|
||||
now = time.time()
|
||||
|
|
Loading…
Reference in New Issue