-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
RTC: audio packet jitter buffer. #4295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
RTC: audio packet jitter buffer. #4295
Conversation
// If packet is beyond window end, stop processing | ||
srs_warn("Audio packet beyond window end, seq=%u, window_end=%u", next_seq, window_end); | ||
break; | ||
} else if (srs_rtp_seq_distance(last_audio_seq_num_, next_seq) > 1) {// If there's a gap and we haven't exceeded wait time, wait for missing packets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If there's a gap and we haven't exceeded wait time, wait for missing packets
This comment has been duplicated.
TRANS_BY_GPT4
@@ -335,6 +342,13 @@ class SrsRtcFrameBuilder | |||
uint16_t header_sn_; | |||
uint16_t lost_sn_; | |||
int64_t rtp_key_frame_ts_; | |||
|
|||
// Audio jitter buffer, map sequence number to packet | |||
std::map<uint16_t, SrsRtpPacket*> audio_buffer_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously, the audio jitter buffer should be a class with its own fields and behaviors, rather than being directly exposed and mixed with the SrsRtcFrameBuilder code.
// Audio jitter buffer, map sequence number to packet
std::map<uint16_t, SrsRtpPacket*> audio_buffer_;
// Last processed sequence number
uint16_t last_audio_seq_num_;
// Last time we processed the jitter buffer
int64_t last_audio_process_time_ms_;
@@ -335,6 +342,13 @@ class SrsRtcFrameBuilder | |||
uint16_t header_sn_; | |||
uint16_t lost_sn_; | |||
int64_t rtp_key_frame_ts_; | |||
|
|||
// Audio jitter buffer, map sequence number to packet | |||
std::map<uint16_t, SrsRtpPacket*> audio_buffer_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the audio buffer is similar to SrsRtpRingBuffer; please consider whether you can use it directly.
195435d
to
97e2b64
Compare
Rtp packets may be retransmitted, disordered, jittery, delayed, etc.There may be abnormalities when converting to rtmp.