place more complete timing data in audio_decode_struct

This commit is contained in:
fduncanh
2022-05-03 16:29:08 -04:00
parent c5c58bc116
commit e6ffc828d2
3 changed files with 8 additions and 3 deletions

View File

@@ -613,7 +613,9 @@ raop_rtp_thread_udp(void *arg)
audio_decode_struct audio_data;
audio_data.data_len = payload_size;
audio_data.data = payload;
audio_data.pts = (uint64_t) ntp_timestamp;
audio_data.ntp_time = (uint64_t) ntp_timestamp;
audio_data.rtp_time = (uint64_t) rtp_time;
audio_data.have_synced = have_synced;
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);

View File

@@ -16,6 +16,7 @@
#define AIRPLAYSERVER_STREAM_H
#include <stdint.h>
#include <stdbool.h>
typedef struct {
int nal_count;
@@ -27,7 +28,9 @@ typedef struct {
typedef struct {
unsigned char *data;
int data_len;
uint64_t pts;
uint64_t ntp_time;
uint64_t rtp_time;
bool have_synced;
} audio_decode_struct;
#endif //AIRPLAYSERVER_STREAM_H

View File

@@ -811,7 +811,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->pts);
audio_renderer_render_buffer(ntp, data->data, data->data_len, data->ntp_time);
}
}