From: qydysky Date: Tue, 31 Oct 2023 14:37:33 +0000 (+0800) Subject: Improve fmp4 调整时间戳避免回溯 X-Git-Tag: v0.11.3~5 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=7490a0aeaf74f1fa7a99960cb0f1d775a1f6c0b4;p=bili_danmu%2F.git Improve fmp4 调整时间戳避免回溯 --- diff --git a/Reply/fmp4Decode.go b/Reply/fmp4Decode.go index 21e5620..9a4a5d1 100644 --- a/Reply/fmp4Decode.go +++ b/Reply/fmp4Decode.go @@ -4,7 +4,6 @@ import ( "bytes" "errors" "io" - "math" "github.com/dustin/go-humanize" F "github.com/qydysky/bili_danmu/F" @@ -330,7 +329,7 @@ func (t *Fmp4Decoder) Search_stream_fmp4(buf []byte, keyframe *slice.Buf[byte]) } //sync audio timeStamp - if diff := math.Abs(audio.getT() - video.getT()); diff > 0.00001 { + if diff := video.getT() - audio.getT(); diff > 0.00001 { date := F.Itob64(int64(video.getT() * float64(audio.firstTimeStamp))) copy(audio.data, date) }