Skip to content

Commit

Permalink
v1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Lijun-Yu committed Aug 17, 2020
1 parent b379424 commit 091d3a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
13 changes: 9 additions & 4 deletions avi_r/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,24 @@ def _get_frame_gen(self, start_frame_id=0, retry=5, retry_step=120):
self._logger.info(
'Failed to seek to frame %d, retrying with frame %d',
start_frame_id, seek_frame_id)
self._container.seek(seek_frame_id, stream=self._stream)
frame_gen = self._fix_missing(start_frame_id)
try:
self._container.seek(seek_frame_id, stream=self._stream)
frame_gen = self._fix_missing(start_frame_id)
frame = next(frame_gen)
break
except StopIteration:
except:
seek_frame_id -= retry_step
else:
seek_frame_id = 0
self._logger.warn(
'Failed to seek to frame %d, iterating from the beginning',
start_frame_id)
self._container.seek(seek_frame_id, stream=self._stream)
try:
self._container.seek(seek_frame_id, stream=self._stream)
except:
self._logger.exception(
'Failed to seek to frame 0, still trying to read the '
'current frame, please check its frame id')
frame_gen = self._fix_missing(seek_frame_id)
frame = next(frame_gen)
while frame.frame_id < start_frame_id:
Expand Down
4 changes: 4 additions & 0 deletions docs/version.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Version History

## AVI-R v1.3.2

* More robust seek.

## AVI-R v1.3.1

* Optimized reorder buffer for faster random access.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='avi-r',
version='1.3.1',
version='1.3.2',
author='Lijun Yu',
author_email='lijun@lj-y.com',
description='A robust reader for avi videos.',
Expand Down

0 comments on commit 091d3a2

Please sign in to comment.