Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pytorch/torchcodec into refactor_seek
Browse files Browse the repository at this point in the history
  • Loading branch information
scotts committed Oct 16, 2024
2 parents 2ea149d + 41c6491 commit 3485205
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/torchcodec/decoders/_core/VideoDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class VideoDecoder {
std::set<int> activeStreamIndices_;
// True when the user wants to seek. The actual pts values to seek to are
// stored in the per-stream metadata in discardFramesBeforePts.
bool hasDesiredPts_;
bool hasDesiredPts_ = false;

// Stores various internal decoding stats.
DecodeStats decodeStats_;
Expand Down
2 changes: 1 addition & 1 deletion src/torchcodec/decoders/_core/VideoDecoderOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void _add_video_stream(
if (device.has_value()) {
if (device.value() == "cpu") {
options.device = torch::Device(torch::kCPU);
} else if (device.value().starts_with("cuda")) {
} else if (device.value().rfind("cuda", 0) == 0) { // starts with "cuda"
std::string deviceStr(device.value());
options.device = torch::Device(deviceStr);
} else {
Expand Down

0 comments on commit 3485205

Please sign in to comment.