mirror of
https://github.com/ossrs/srs.git
synced 2026-10-24 09:59:20 +03:00
Fixes #4762: with `srt_to_rtmp on`, 48 kHz AAC published over SRT got wrong per-frame timestamps on the RTMP side, so the audio of RTMP playback, HLS and forwards crackled. This replaces #4765, and keeps its author's credit for what was learned from it. ## Cause An SRT publisher such as FFmpeg packs several AAC frames into one PES, which carries a single PTS. `SrsSrtFrameBuilder::on_ts_audio()` times frame `i` at `pts + i * 1024 / sample_rate`, and took `sample_rate` from the FLV sound rate, which has only 5.5, 11, 22 and 44.1 kHz: - 48 kHz frames were stamped 23.22 ms apart instead of 21.33 ms, and the timeline stepped at each PES. - Every other rate FLV can't represent was wrong too: 96, 88.2, 64, 32, 24, 16, 12, 8 and 7.35 kHz. - Players that place audio by timestamp, such as hls.js and YouTube ingest, played gaps and overlaps. flv.js and ffplay hide it. It regressed in the SRS 5.0 SRT rewrite. The AAC sequence header was already right, and the UDP MPEG-TS ingest path already used the AAC rate. ## Fix Take the rate from the ADTS `sampling_frequency_index`, as the UDP MPEG-TS path does, and keep 44.1 kHz for a reserved index, which has no rate. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Nandisha <61039123+AlexFreik@users.noreply.github.com>
28 lines
435 B
Go
28 lines
435 B
Go
// Copyright (c) 2026 Winlin
|
|
//
|
|
// SPDX-License-Identifier: MIT
|
|
package version
|
|
|
|
import "fmt"
|
|
|
|
func VersionMajor() int {
|
|
return 8
|
|
}
|
|
|
|
// VersionMinor specifies the typical version of SRS we adapt to.
|
|
func VersionMinor() int {
|
|
return 0
|
|
}
|
|
|
|
func VersionRevision() int {
|
|
return 64
|
|
}
|
|
|
|
func Version() string {
|
|
return fmt.Sprintf("%v.%v.%v", VersionMajor(), VersionMinor(), VersionRevision())
|
|
}
|
|
|
|
func Signature() string {
|
|
return "SRSX"
|
|
}
|