File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -860,6 +860,23 @@ def test_pts(self, asset):
860860
861861 assert pts_seconds == start_seconds
862862
863+ def test_decode_before_frame_start (self ):
864+ # Test illustrating bug described in
865+ # https://github.com/pytorch/torchcodec/issues/567
866+ asset = NASA_AUDIO_MP3
867+
868+ decoder = create_from_file (str (asset .path ), seek_mode = "approximate" )
869+ add_audio_stream (decoder )
870+
871+ frames , * _ = get_frames_by_pts_in_range_audio (
872+ decoder , start_seconds = 0 , stop_seconds = 0.05
873+ )
874+ all_frames , * _ = get_frames_by_pts_in_range_audio (
875+ decoder , start_seconds = 0 , stop_seconds = None
876+ )
877+ # TODO fix this. `frames` should be empty.
878+ torch .testing .assert_close (frames , all_frames )
879+
863880
864881if __name__ == "__main__" :
865882 pytest .main ()
You can’t perform that action at this time.
0 commit comments