Skip to content

Commit

Permalink
Fix out of range indices on last frame
Browse files Browse the repository at this point in the history
  • Loading branch information
shawwn committed May 25, 2017
1 parent 2f569d0 commit aec97bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions moviepy/audio/io/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ def get_frame(self, tt):
try:
result = np.zeros((len(tt),self.nchannels))
indices = frames - self.buffer_startframe
if len(self.buffer) < self.buffersize // 2:
indices = indices - (self.buffersize // 2 - len(self.buffer) + 1)
result[in_time] = self.buffer[indices]
return result

Expand Down

0 comments on commit aec97bf

Please sign in to comment.