From: Mike Brady Date: Sat, 13 Jun 2020 09:41:48 +0000 (+0100) Subject: Remove the flsr flush request token -- sometimes it's bogus -- add the frame number... X-Git-Tag: 3.3.7d12~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f9f3331e35234bba09a58ecc2e1f2cac226ef31;p=thirdparty%2Fshairport-sync.git Remove the flsr flush request token -- sometimes it's bogus -- add the frame number to the pfls token. Add a little documentation. --- diff --git a/player.c b/player.c index cfa58f32..2fd6bc88 100644 --- a/player.c +++ b/player.c @@ -3059,9 +3059,12 @@ void player_flush(uint32_t timestamp, rtsp_conn_info *conn) { #ifdef CONFIG_METADATA // only send a flush metadata message if the first packet has been seen -- it's a bogus message // otherwise + if (conn->first_packet_timestamp) { - debug(2, "pfls"); - send_ssnc_metadata('pfls', NULL, 0, 1); // contains cancellation points + debug(2, "pfls"); + char numbuf[32]; + snprintf(numbuf, sizeof(numbuf),"%u",timestamp); + send_ssnc_metadata('pfls', numbuf, strlen(numbuf), 1); // contains cancellation points } #endif } diff --git a/rtsp.c b/rtsp.c index 9057b983..4296bc19 100644 --- a/rtsp.c +++ b/rtsp.c @@ -926,12 +926,17 @@ void handle_flush(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) { } } // debug(1,"RTSP Flush Requested: %u.",rtptime); + +// the following is now done better by the player_flush routine as a 'pfls' +/* #ifdef CONFIG_METADATA if (p) send_metadata('ssnc', 'flsr', p + 1, strlen(p + 1), req, 1); else send_metadata('ssnc', 'flsr', NULL, 0, NULL, 0); #endif +*/ + player_flush(rtptime, conn); // will not crash even it there is no player thread. resp->respcode = 200; @@ -1145,7 +1150,10 @@ void handle_set_parameter_parameter(rtsp_conn_info *conn, rtsp_message *req, // 'aend' -- active mode exited. No arguments // 'pbeg' -- play stream begin. No arguments // 'pend' -- play stream end. No arguments -// 'pfls' -- play stream flush. No arguments +// 'pfls' -- play stream flush. The argument is an unsigned 32-bit +// frame number. It seems that all frames up to but not +// including this frame are to be flushed. +// // 'prsm' -- play stream resume. No arguments // `pffr` -- the first frame of a play session has been received and has been validly // timed. @@ -1185,8 +1193,11 @@ void handle_set_parameter_parameter(rtsp_conn_info *conn, rtsp_message *req, // to send commands to the source's remote control (if it has one). // `clip` -- the payload is the IP number of the client, i.e. the sender of audio. // Can be an IPv4 or an IPv6 number. +// `svip` -- the payload is the IP number of the server, i.e. the player itself. +// Can be an IPv4 or an IPv6 number. // `dapo` -- the payload is the port number (as text) on the server to which remote // control commands should be sent. It is 3689 for iTunes but varies for iOS devices. + // A special sub-protocol is used for sending large data items over UDP // If the payload exceeded 4 MB, it is chunked using the following format: // "ssnc", "chnk", packet_ix, packet_counts, packet_tag, packet_type, chunked_data.