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 @@ -850,6 +850,23 @@ def test_pts(self, asset):
850850 else :
851851 assert pts_seconds == start_seconds
852852
853+ def test_decode_before_frame_start (self ):
854+ # Test illustrating bug described in
855+ # https://github.com/pytorch/torchcodec/issues/567
856+ asset = NASA_AUDIO_MP3
857+
858+ decoder = create_from_file (str (asset .path ), seek_mode = "approximate" )
859+ add_audio_stream (decoder )
860+
861+ frames , * _ = get_frames_by_pts_in_range_audio (
862+ decoder , start_seconds = 0 , stop_seconds = 0.05
863+ )
864+ all_frames , * _ = get_frames_by_pts_in_range_audio (
865+ decoder , start_seconds = 0 , stop_seconds = None
866+ )
867+ # TODO fix this. `frames` should be empty.
868+ torch .testing .assert_close (frames , all_frames )
869+
853870
854871if __name__ == "__main__" :
855872 pytest .main ()
You can’t perform that action at this time.
0 commit comments