Skip to content

Commit

Permalink
Fixed FFmpeg seeking bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-venugopal committed Sep 25, 2023
1 parent 63c732f commit c9b91e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/FFmpeg/Wrappers/FFmpegFileContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class FFmpegFileContext {
// Represents the target seek position that the format context understands.
// We need to determine a target frame, given the seek position in seconds,
// duration, and frame count.
let timestamp = Int64(time * stream.timeBaseReciprocalRatio)
let timestamp = Int64(time * stream.timeBaseRatio)

// Validate the target frame (cannot exceed the total frame count)
if stream.timeBaseDuration > 0, timestamp >= stream.timeBaseDuration {throw SeekError(ERROR_EOF)}
Expand Down

0 comments on commit c9b91e6

Please sign in to comment.