Skip to content

Commit 142abda

Browse files
committed
Merge branch 'fix-timebase' into dts_fallback
2 parents ce04b3c + 06cd220 commit 142abda

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/torchcodec/_core/SingleStreamDecoder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ void SingleStreamDecoder::initializeDecoder() {
160160
}
161161

162162
if (formatContext_->duration > 0) {
163+
AVRational defaultTimeBase{1, AV_TIME_BASE};
163164
containerMetadata_.durationSeconds =
164-
ptsToSeconds(formatContext_->duration, AV_TIME_BASE_Q);
165+
ptsToSeconds(formatContext_->duration, defaultTimeBase);
165166
}
166167

167168
if (formatContext_->bit_rate > 0) {

0 commit comments

Comments
 (0)