Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/src/st2110/st_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,8 @@ struct st_rx_audio_session_impl {
int st30_pkt_idx; /* pkt index in current frame */
int latest_seq_id; /* latest seq id */

uint32_t first_pkt_rtp_ts; /* rtp time stamp for the first pkt */

uint32_t tmstamp;
size_t frame_recv_size;

Expand Down
8 changes: 6 additions & 2 deletions lib/src/st2110/st_rx_audio_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ static int rx_audio_session_handle_frame_pkt(struct mtl_main_impl* impl,
uint8_t payload_type = rtp->payload_type;
uint32_t pkt_len = mbuf->data_len - sizeof(struct st_rfc3550_audio_hdr);

if (s->st30_pkt_idx == 0) {
s->first_pkt_rtp_ts = tmstamp;
}

if (ops->payload_type && (payload_type != ops->payload_type)) {
dbg("%s(%d,%d), get payload_type %u but expect %u\n", __func__, s->idx, s_port,
payload_type, ops->payload_type);
Expand Down Expand Up @@ -359,11 +363,11 @@ static int rx_audio_session_handle_frame_pkt(struct mtl_main_impl* impl,
}

meta->tfmt = ST10_TIMESTAMP_FMT_MEDIA_CLK;
meta->timestamp = tmstamp;
meta->timestamp = s->first_pkt_rtp_ts;
meta->fmt = ops->fmt;
meta->sampling = ops->sampling;
meta->channel = ops->channel;
meta->rtp_timestamp = tmstamp;
meta->rtp_timestamp = s->first_pkt_rtp_ts;
meta->frame_recv_size = s->frame_recv_size;

MT_USDT_ST30_RX_FRAME_AVAILABLE(s->mgr->idx, s->idx, frame->idx, frame->addr, tmstamp,
Expand Down
Loading