mirror of
https://github.com/zergon321/reisen.git
synced 2025-09-26 20:01:14 +08:00
Compatibility fixed.
This commit is contained in:
@@ -10,3 +10,7 @@ func bufferSize(maxBufferSize C.int) C.ulong {
|
|||||||
func channelLayout(audio *AudioStream) C.longlong {
|
func channelLayout(audio *AudioStream) C.longlong {
|
||||||
return C.longlong(audio.codecCtx.channel_layout)
|
return C.longlong(audio.codecCtx.channel_layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func rewindPosition(dur int64) C.longlong {
|
||||||
|
return C.longlong(dur)
|
||||||
|
}
|
||||||
|
@@ -10,3 +10,7 @@ func bufferSize(maxBufferSize C.int) C.ulong {
|
|||||||
func channelLayout(audio *AudioStream) C.long {
|
func channelLayout(audio *AudioStream) C.long {
|
||||||
return C.long(audio.codecCtx.channel_layout)
|
return C.long(audio.codecCtx.channel_layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func rewindPosition(dur int64) C.long {
|
||||||
|
return C.long(dur)
|
||||||
|
}
|
||||||
|
@@ -10,3 +10,7 @@ func bufferSize(maxBufferSize C.int) C.ulonglong {
|
|||||||
func channelLayout(audio *AudioStream) C.longlong {
|
func channelLayout(audio *AudioStream) C.longlong {
|
||||||
return C.longlong(audio.codecCtx.channel_layout)
|
return C.longlong(audio.codecCtx.channel_layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func rewindPosition(dur int64) C.longlong {
|
||||||
|
return C.longlong(dur)
|
||||||
|
}
|
||||||
|
@@ -194,7 +194,7 @@ func (stream *baseStream) Rewind(t time.Duration) error {
|
|||||||
dur := int64(seconds * factor)
|
dur := int64(seconds * factor)
|
||||||
|
|
||||||
status := C.av_seek_frame(stream.media.ctx,
|
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)
|
C.AVSEEK_FLAG_FRAME|C.AVSEEK_FLAG_BACKWARD)
|
||||||
|
|
||||||
if status < 0 {
|
if status < 0 {
|
||||||
|
Reference in New Issue
Block a user