Working for Realtime Audio Streams

This commit is contained in:
Mike Brady
2021-04-30 14:55:11 +01:00
parent 390eeae3df
commit 91b85a0207
3 changed files with 41 additions and 22 deletions
+6 -4
View File
@@ -415,10 +415,12 @@ void set_dacp_server_information(rtsp_conn_info *conn) {
// This is different to other AirPlay clients
// which return immediately with a 403 code if there are no changes.
dacp_server.always_use_revision_number_1 = 0;
char *p = strstr(conn->UserAgent, "forked-daapd");
if ((p != 0) &&
(p == conn->UserAgent)) { // must exist and be at the start of the UserAgent string
dacp_server.always_use_revision_number_1 = 1;
if (conn->UserAgent != NULL) {
char *p = strstr(conn->UserAgent, "forked-daapd");
if ((p != 0) &&
(p == conn->UserAgent)) { // must exist and be at the start of the UserAgent string
dacp_server.always_use_revision_number_1 = 1;
}
}
metadata_hub_modify_prolog();
+33 -16
View File
@@ -1007,10 +1007,6 @@ void reset_ntp_anchor_info(rtsp_conn_info *conn) {
debug_mutex_unlock(&conn->reference_time_mutex, 3);
}
void reset_anchor_info(rtsp_conn_info *conn) {
reset_ntp_anchor_info(conn);
}
int have_ntp_timestamp_timing_information(rtsp_conn_info *conn) {
if (conn->anchor_rtptime == 0)
return 0;
@@ -1018,10 +1014,6 @@ int have_ntp_timestamp_timing_information(rtsp_conn_info *conn) {
return 1;
}
int have_timestamp_timing_information(rtsp_conn_info *conn) {
return have_ntp_timestamp_timing_information(conn);
}
// set this to zero to use the rates supplied by the sources, which might not always be completely
// right...
const int use_nominal_rate = 0; // specify whether to use the nominal input rate, usually 44100 fps
@@ -1196,14 +1188,6 @@ void rtp_request_resend(seq_t first, uint32_t count, rtsp_conn_info *conn) {
}
}
int frame_to_local_time(uint32_t timestamp, uint64_t *time, rtsp_conn_info *conn) {
return frame_to_ntp_local_time(timestamp, time, conn);
}
int local_time_to_frame(uint64_t time, uint32_t *frame, rtsp_conn_info *conn) {
return local_ntp_time_to_frame(time, frame, conn);
}
#ifdef CONFIG_AIRPLAY_2
void set_ptp_anchor_info(rtsp_conn_info *conn, uint64_t clock_id, uint32_t rtptime,
@@ -2360,5 +2344,38 @@ void *rtp_buffered_audio_processor(void *arg) {
pthread_cleanup_pop(1); // do the cleanup.
pthread_exit(NULL);
}
int frame_to_local_time(uint32_t timestamp, uint64_t *time, rtsp_conn_info *conn) {
return frame_to_ptp_local_time(timestamp, time, conn);
}
int local_time_to_frame(uint64_t time, uint32_t *frame, rtsp_conn_info *conn) {
return local_ptp_time_to_frame(time, frame, conn);
}
void reset_anchor_info(rtsp_conn_info *conn) {
reset_ptp_anchor_info(conn);
}
int have_timestamp_timing_information(rtsp_conn_info *conn) {
return have_ptp_timing_information(conn);
}
#else
int frame_to_local_time(uint32_t timestamp, uint64_t *time, rtsp_conn_info *conn) {
return frame_to_ntp_local_time(timestamp, time, conn);
}
int local_time_to_frame(uint64_t time, uint32_t *frame, rtsp_conn_info *conn) {
return local_ntp_time_to_frame(time, frame, conn);
}
void reset_anchor_info(rtsp_conn_info *conn) {
reset_ntp_anchor_info(conn);
}
int have_timestamp_timing_information(rtsp_conn_info *conn) {
return have_ntp_timestamp_timing_information(conn);
}
#endif
+2 -2
View File
@@ -2016,10 +2016,10 @@ void handle_post(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) {
} else if (strcmp(req->path, "/fp-setup") == 0) {
handle_fp_setup(conn, req, resp);
} else {
debug(2, "Connection %d: POST %s Content-Length %d", conn->connection_number, req->path,
debug(3, "Connection %d: POST %s Content-Length %d", conn->connection_number, req->path,
req->contentlength);
debug_log_rtsp_message(2, "POST request", req);
debug(2, "Unhandled POST, path \"%s\".", req->path);
debug(3, "Unhandled POST, path \"%s\".", req->path);
}
}