Skip to content

Commit 30622a7

Browse files
committed
Timebase
1 parent 1d0c275 commit 30622a7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/torchcodec/_core/CudaDeviceInterface.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,11 @@ void CudaDeviceInterface::initialize(
189189
AVCodecContext* codecContext,
190190
[[maybe_unused]] const VideoStreamOptions& videoStreamOptions,
191191
[[maybe_unused]] const std::vector<std::unique_ptr<Transform>>& transforms,
192-
[[maybe_unused]] const AVRational& timeBase,
192+
const AVRational& timeBase,
193193
const FrameDims& outputDims) {
194194
TORCH_CHECK(!ctx_, "FFmpeg HW device context already initialized");
195195

196+
timeBase_ = timeBase;
196197
outputDims_ = outputDims;
197198

198199
// It is important for pytorch itself to create the cuda context. If ffmpeg

src/torchcodec/_core/CudaDeviceInterface.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class CudaDeviceInterface : public DeviceInterface {
3434
std::nullopt) override;
3535

3636
private:
37+
AVRational timeBase_;
3738
FrameDims outputDims_;
3839
UniqueAVBufferRef ctx_;
3940
std::unique_ptr<NppStreamContext> nppCtx_;

0 commit comments

Comments
 (0)