mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-14 00:04:13 +09:00
add seqnum to audio_decode_struct
This commit is contained in:
@@ -667,12 +667,14 @@ raop_rtp_thread_udp(void *arg)
|
||||
audio_data.ntp_time = raop_rtp->ntp_start_time + (uint64_t) elapsed_time;
|
||||
audio_data.ntp_time -= raop_rtp->rtp_sync_offset;
|
||||
audio_data.rtp_time = rtp64_timestamp;
|
||||
audio_data.seqnum = seqnum;
|
||||
raop_rtp->callbacks.audio_process(raop_rtp->callbacks.cls, raop_rtp->ntp, &audio_data);
|
||||
free(payload);
|
||||
uint64_t ntp_now = raop_ntp_get_local_time(raop_rtp->ntp);
|
||||
int64_t latency = ((int64_t) ntp_now) - ((int64_t) audio_data.ntp_time);
|
||||
logger_log(raop_rtp->logger, LOGGER_DEBUG, "raop_rtp audio: now = %8.6f, npt = %8.6f, latency = %8.6f, rtp_time=%u seqnum = %u",
|
||||
((double) ntp_now ) / SEC, ((double) audio_data.ntp_time) / SEC, ((double) latency) / SEC, (uint32_t) rtp64_timestamp, seqnum);
|
||||
((double) ntp_now ) / SEC, ((double) audio_data.ntp_time) / SEC, ((double) latency) / SEC, (uint32_t) rtp64_timestamp,
|
||||
seqnum);
|
||||
}
|
||||
|
||||
/* Handle possible resend requests */
|
||||
|
||||
@@ -30,6 +30,7 @@ typedef struct {
|
||||
int data_len;
|
||||
uint64_t ntp_time;
|
||||
uint64_t rtp_time;
|
||||
unsigned short seqnum;
|
||||
} audio_decode_struct;
|
||||
|
||||
#endif //AIRPLAYSERVER_STREAM_H
|
||||
|
||||
@@ -34,7 +34,7 @@ void audio_renderer_init(logger_t *logger, const char* audiosink);
|
||||
void audio_renderer_start(unsigned char* compression_type);
|
||||
void audio_renderer_stop();
|
||||
void audio_renderer_render_buffer(raop_ntp_t *ntp, unsigned char* data, int data_len,
|
||||
uint64_t ntp_time, uint64_t rtp_time);
|
||||
uint64_t ntp_time, uint64_t rtp_time, unsigned short seqnum);
|
||||
void audio_renderer_set_volume(float volume);
|
||||
void audio_renderer_flush();
|
||||
void audio_renderer_destroy();
|
||||
|
||||
@@ -182,7 +182,7 @@ void audio_renderer_start(unsigned char *ct) {
|
||||
}
|
||||
|
||||
void audio_renderer_render_buffer(raop_ntp_t *ntp, unsigned char* data, int data_len, uint64_t ntp_time,
|
||||
uint64_t rtp_time) {
|
||||
uint64_t rtp_time, unsigned short seqnum) {
|
||||
GstBuffer *buffer;
|
||||
bool valid;
|
||||
if (data_len == 0 || renderer == NULL) return;
|
||||
|
||||
@@ -813,7 +813,7 @@ extern "C" void audio_process (void *cls, raop_ntp_t *ntp, audio_decode_struct *
|
||||
dump_audio_to_file(data->data, data->data_len, (data->data)[0] & 0xf0);
|
||||
}
|
||||
if (use_audio) {
|
||||
audio_renderer_render_buffer(ntp, data->data, data->data_len, data->ntp_time, data->rtp_time);
|
||||
audio_renderer_render_buffer(ntp, data->data, data->data_len, data->ntp_time, data->rtp_time, data->seqnum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user