8000 Small animation cleanup. · matplotlib/matplotlib@d82dd36 · GitHub
[go: up one dir, main page]

Skip to content

Commit d82dd36

Browse files
committed
Small animation cleanup.
Animation.extra_args is always a list (we normalize None to be the rc in the constructor) so we don't need to separately handle the empty case.
1 parent 0310b8a commit d82dd36

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/matplotlib/animation.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -579,12 +579,9 @@ def output_args(self):
579579
# OSX). Also fixes internet explorer. This is as of 2015/10/29.
580580
if self.codec == 'h264' and '-pix_fmt' not in self.extra_args:
581581
args.extend(['-pix_fmt', 'yuv420p'])
582-
# The %dk adds 'k' as a suffix so that ffmpeg treats our bitrate as in
583-
# kbps
584582
if self.bitrate > 0:
585-
args.extend(['-b', '%dk' % self.bitrate])
586-
if self.extra_args:
587-
args.extend(self.extra_args)
583+
args.extend(['-b', '%dk' % self.bitrate]) # %dk: bitrate in kbps.
584+
args.extend(self.extra_args)
588585
for k, v in self.metadata.items():
589586
args.extend(['-metadata', '%s=%s' % (k, v)])
590587

@@ -696,11 +693,7 @@ def delay(self):
696693

697694
@property
698695
def output_args(self):
699-
if self.extra_args:
700-
args = list(self.extra_args)
701-
else:
702-
args = []
703-
return args + [self.outfile]
696+
return [*self.extra_args, self.outfile]
704697

705698
@classmethod
706699
def bin_path(cls):

0 commit comments

Comments
 (0)
0