Skip to content

Commit e9a04a2

Browse files
committed
analyze.run: fixed show_log=True behavior
1 parent 173eca9 commit e9a04a2

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/ffmpegio/analyze.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,14 @@ def run(
271271
capture_log=True,
272272
universal_newlines=True,
273273
stdout=fp.PIPE,
274+
stderr=fp.PIPE if show_log else None,
274275
)
275276

276-
# print the collected log data if requested
277-
if show_log:
278-
print(out.stderr)
279-
280277
# if FFmpeg terminated abnormally, return error
281278
if out.returncode:
282-
raise FFmpegError(out.stderr, False)
279+
if show_log:
280+
print(out.stderr)
281+
raise FFmpegError(out.stderr, show_log)
283282

284283
# link a logger to each metadata field names (trailing "lavifi.")
285284
meta_logger = {name: l for l in loggers for name in l.meta_names}

0 commit comments

Comments
 (0)