Skip to content

Commit

Permalink
Support old "lastread" name as property, for existing libraries that …
Browse files Browse the repository at this point in the history
…use it.
  • Loading branch information
bzczb committed Feb 14, 2024
1 parent 1da7b8d commit dbc0d35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions moviepy/video/io/ffmpeg_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ def get_frame_number(self, t):
# are getting the nth frame by writing get_frame(n/fps).
return int(self.fps * t + 0.00001)

@property
def lastread(self):
"""Support old name of the "last_read" attribute, which may be used
by existing libraries, such as scenedetect.
"""
return self.last_read

def close(self, delete_last_read=True):
"""Closes the reader terminating the process, if is still open."""
if self.proc:
Expand Down

0 comments on commit dbc0d35

Please sign in to comment.