]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Remove redundant (?) calls to 'prepare_decoding_chain()'.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 11 Dec 2025 16:44:16 +0000 (16:44 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 11 Dec 2025 16:44:16 +0000 (16:44 +0000)
ap2_buffered_audio_processor.c
player.c
rtsp.c

index e41ce88310385c5b166ea64744b2e02e56b698ef..10dd9155a9cd530d0a76e431b500b6bd4af015a8 100644 (file)
@@ -274,7 +274,7 @@ void *rtp_buffered_audio_processor(void *arg) {
 
           if (blocks_read_since_play_began == 1) {
             debug(2, "Preparing initial decoding chain for %s.", get_ssrc_name(payload_ssrc));
-            prepare_decoding_chain(conn, payload_ssrc);
+            prepare_decoding_chain(conn, payload_ssrc); // needed to set the input rate...
             sequence_number_for_player =
                 seq_no & 0xffff; // this is arbitrary -- the sequence_number_for_player numbers will
                                  // be sequential irrespective of seq_no jumps...
@@ -290,7 +290,7 @@ void *rtp_buffered_audio_processor(void *arg) {
                       "Reading a block: new encoding: %s, old encoding: %s. Preparing a new "
                       "decoding chain.",
                       get_ssrc_name(payload_ssrc), get_ssrc_name(previous_ssrc));
-                prepare_decoding_chain(conn, payload_ssrc);
+                // prepare_decoding_chain(conn, payload_ssrc);
               }
             }
 
@@ -441,7 +441,7 @@ void *rtp_buffered_audio_processor(void *arg) {
             int64_t lead_time = buffer_should_be_time - get_absolute_time_in_ns();
             payload_length = 0;
             if (ssrc_is_recognised(payload_ssrc) != 0) {
-              prepare_decoding_chain(conn, payload_ssrc);
+              // prepare_decoding_chain(conn, payload_ssrc);
               unsigned long long new_payload_length = 0;
               payload_pointer = m + leading_free_space_length;
               if ((lead_time < (int64_t)30000000000L) &&
@@ -517,7 +517,7 @@ void *rtp_buffered_audio_processor(void *arg) {
                   } else {
                     timestamp_difference = timestamp - expected_timestamp;
                     if (timestamp_difference != 0) {
-                      debug(2,
+                      debug(1,
                             "Connection %d: "
                             "unexpected timestamp in block %u. Actual: %u, expected: %u "
                             "difference: %d, "
@@ -542,7 +542,7 @@ void *rtp_buffered_audio_processor(void *arg) {
                     int32_t abs_timestamp_difference = -timestamp_difference;
                     if ((size_t)abs_timestamp_difference > get_ssrc_block_length(payload_ssrc)) {
                       skip_this_block = 1;
-                      debug(2,
+                      debug(1,
                             "skipping block %u because it is too old. Timestamp "
                             "difference: %d, length of block: %u.",
                             seq_no, timestamp_difference, get_ssrc_block_length(payload_ssrc));
index 2aa0cd7bc2f1e4e989738f082ad7627cf1dca58f..b2242b18e6529d0191bd1222cf21f34ee14a2d68 100644 (file)
--- a/player.c
+++ b/player.c
@@ -1034,7 +1034,7 @@ void prepare_decoding_chain(rtsp_conn_info *conn, ssrc_t ssrc) {
 
     if ((config.statistics_requested != 0) && (ssrc != SSRC_NONE) &&
         (conn->incoming_ssrc != SSRC_NONE)) {
-      debug(1, "Connection %d: incoming audio switching to \"%s\".", conn->connection_number,
+      debug(3, "Connection %d: incoming audio switching to \"%s\".", conn->connection_number,
             get_ssrc_name(ssrc));
 #ifdef CONFIG_METADATA
       send_ssnc_metadata('sdsc', get_ssrc_name(ssrc), strlen(get_ssrc_name(ssrc)), 1);
@@ -2728,8 +2728,8 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn, int resync_requested) {
           debug(2, "setting up software resampler for %s for the first time.",
                 get_ssrc_name(curframe->ssrc));
         } else {
-          debug(2, "SSRC has changed from %s to %s.", get_ssrc_name(conn->resampler_ssrc),
-                get_ssrc_name(curframe->ssrc));
+          debug(1, "Connection %d: incoming audio switching to \"%s\".", conn->connection_number,
+            get_ssrc_name(curframe->ssrc));
           clear_software_resampler(conn);
           // ask the backend if it can give us its best choice for an ffmpeg configuration:
         }
diff --git a/rtsp.c b/rtsp.c
index dc82dcb551818782a61a859d7b7bdb10d46a8a53..eff9fdf764bf93ebba2921ab12153f22af65f0ee 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -2739,7 +2739,7 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp)
           // airplay 2 always allows interruption, so should never return
           // play_lock_aquisition_failed
           if (get_play_lock(conn, 1) != play_lock_aquisition_failed) {
-            debug(1, "Connection %d: %s AP2 setup -- play lock acquired.", conn->connection_number,
+            debug(2, "Connection %d: %s AP2 setup -- play lock acquired.", conn->connection_number,
                   get_category_string(conn->airplay_stream_category));
 
 #ifdef CONFIG_METADATA
@@ -2910,7 +2910,7 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp)
 
             // since the GID from the client has been acquired, update the airplay bonjour strings.
             build_bonjour_strings(conn);
-            debug(1, "Connection %d: SETUP mdns_update on %s.", conn->connection_number,
+            debug(2, "Connection %d: SETUP mdns_update on %s.", conn->connection_number,
                   get_category_string(conn->airplay_stream_category));
             mdns_update(NULL, secondary_txt_records);