forked from DRMTalks/devine
Raise CalledProcessError if Shaka logs an error
This seems to be necessary as Shaka-packager seems to always return exit code 0, even on errors.
This commit is contained in:
parent
f3cfaa3ab3
commit
aff40df7d1
|
@ -259,6 +259,7 @@ class Widevine:
|
||||||
)
|
)
|
||||||
|
|
||||||
stream_skipped = False
|
stream_skipped = False
|
||||||
|
had_error = False
|
||||||
|
|
||||||
shaka_log_buffer = ""
|
shaka_log_buffer = ""
|
||||||
for line in iter(p.stderr.readline, ""):
|
for line in iter(p.stderr.readline, ""):
|
||||||
|
@ -270,6 +271,8 @@ class Widevine:
|
||||||
stream_skipped = True
|
stream_skipped = True
|
||||||
if ":INFO:" in line:
|
if ":INFO:" in line:
|
||||||
continue
|
continue
|
||||||
|
if ":ERROR:" in line:
|
||||||
|
had_error = True
|
||||||
if "Insufficient bits in bitstream for given AVC profile" in line:
|
if "Insufficient bits in bitstream for given AVC profile" in line:
|
||||||
# this is a warning and is something we don't have to worry about
|
# this is a warning and is something we don't have to worry about
|
||||||
continue
|
continue
|
||||||
|
@ -286,7 +289,7 @@ class Widevine:
|
||||||
|
|
||||||
p.wait()
|
p.wait()
|
||||||
|
|
||||||
if p.returncode != 0:
|
if p.returncode != 0 or had_error:
|
||||||
raise subprocess.CalledProcessError(p.returncode, arguments)
|
raise subprocess.CalledProcessError(p.returncode, arguments)
|
||||||
|
|
||||||
path.unlink()
|
path.unlink()
|
||||||
|
|
Loading…
Reference in New Issue