diff --git a/lib/raop_rtp.c b/lib/raop_rtp.c index 463dfa6..ea929e9 100644 --- a/lib/raop_rtp.c +++ b/lib/raop_rtp.c @@ -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 */ diff --git a/lib/stream.h b/lib/stream.h index bd61587..c5e9186 100644 --- a/lib/stream.h +++ b/lib/stream.h @@ -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 diff --git a/renderers/audio_renderer.h b/renderers/audio_renderer.h index 239f053..094cb32 100644 --- a/renderers/audio_renderer.h +++ b/renderers/audio_renderer.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(); diff --git a/renderers/audio_renderer_gstreamer.c b/renderers/audio_renderer_gstreamer.c index 7c2c279..6fd85ce 100644 --- a/renderers/audio_renderer_gstreamer.c +++ b/renderers/audio_renderer_gstreamer.c @@ -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; diff --git a/uxplay.cpp b/uxplay.cpp index f5ae224..d2b196d 100644 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -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); } }