diff --git a/platform_darwin.go b/platform_darwin.go index 2a18384..a542344 100644 --- a/platform_darwin.go +++ b/platform_darwin.go @@ -10,3 +10,7 @@ func bufferSize(maxBufferSize C.int) C.ulong { func channelLayout(audio *AudioStream) C.longlong { return C.longlong(audio.codecCtx.channel_layout) } + +func rewindPosition(dur int64) C.longlong { + return C.longlong(dur) +} diff --git a/platform_linux.go b/platform_linux.go index de01f44..5f0cd64 100644 --- a/platform_linux.go +++ b/platform_linux.go @@ -10,3 +10,7 @@ func bufferSize(maxBufferSize C.int) C.ulong { func channelLayout(audio *AudioStream) C.long { return C.long(audio.codecCtx.channel_layout) } + +func rewindPosition(dur int64) C.long { + return C.long(dur) +} diff --git a/platform_windows.go b/platform_windows.go index 8d2a6e0..42b4460 100644 --- a/platform_windows.go +++ b/platform_windows.go @@ -10,3 +10,7 @@ func bufferSize(maxBufferSize C.int) C.ulonglong { func channelLayout(audio *AudioStream) C.longlong { return C.longlong(audio.codecCtx.channel_layout) } + +func rewindPosition(dur int64) C.longlong { + return C.longlong(dur) +} diff --git a/stream.go b/stream.go index 7a2bf13..2e4aa93 100644 --- a/stream.go +++ b/stream.go @@ -194,7 +194,7 @@ func (stream *baseStream) Rewind(t time.Duration) error { dur := int64(seconds * factor) status := C.av_seek_frame(stream.media.ctx, - stream.inner.index, C.long(dur), + stream.inner.index, rewindPosition(dur), C.AVSEEK_FLAG_FRAME|C.AVSEEK_FLAG_BACKWARD) if status < 0 {