Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/decoders/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,23 @@ def test_pts(self, asset):
else:
assert pts_seconds == start_seconds

def test_decode_before_frame_start(self):
# Test illustrating bug described in
# https://github.com/pytorch/torchcodec/issues/567
asset = NASA_AUDIO_MP3

decoder = create_from_file(str(asset.path), seek_mode="approximate")
add_audio_stream(decoder)

frames, *_ = get_frames_by_pts_in_range_audio(
decoder, start_seconds=0, stop_seconds=0.05
)
all_frames, *_ = get_frames_by_pts_in_range_audio(
decoder, start_seconds=0, stop_seconds=None
)
# TODO fix this. `frames` should be empty.
torch.testing.assert_close(frames, all_frames)


if __name__ == "__main__":
pytest.main()
Loading