File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -336,10 +336,10 @@ void SingleStreamDecoder::readCustomFrameMappingsUpdateMetadataAndIndex(
336336 int64_t numFrames = all_frames.size (0 );
337337 streamInfos_[streamIndex].allFrames .reserve (numFrames);
338338 streamInfos_[streamIndex].keyFrames .reserve (numFrames);
339- // Access tensor data directly rather than element wise to speed up loop below
340- auto * pts_data = all_frames.data_ptr <int64_t >();
341- auto * is_key_frame_data = is_key_frame.data_ptr <bool >();
342- auto * duration_data = duration.data_ptr <int64_t >();
339+ // Use accessor to efficiently access tensor elements
340+ auto pts_data = all_frames.accessor <int64_t , 1 >();
341+ auto is_key_frame_data = is_key_frame.accessor <bool , 1 >();
342+ auto duration_data = duration.accessor <int64_t , 1 >();
343343
344344 auto & streamMetadata = containerMetadata_.allStreamMetadata [streamIndex];
345345
You can’t perform that action at this time.
0 commit comments