]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
fix flush of a large sync error, hopefully.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 13 May 2021 19:10:38 +0000 (20:10 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 13 May 2021 19:10:38 +0000 (20:10 +0100)
player.c

index c8eca4deaf6d6f56224b34a763b3d82635101caf..1a4d855eb79cbc1fb7b5ce4dab534383156d7d4b 100644 (file)
--- a/player.c
+++ b/player.c
@@ -2305,15 +2305,8 @@ void *player_thread_func(void *arg) {
                 debug(1, "Large positive sync error of: %" PRId64 " frames (%f seconds).",
                       sync_error, (sync_error * 1.0) / config.output_rate);
                 int64_t local_frames_to_drop = sync_error / conn->output_sample_ratio;
-                uint32_t frames_to_drop_sized = local_frames_to_drop;
-
-                debug_mutex_lock(&conn->flush_mutex, 1000, 1);
-                conn->flush_rtp_timestamp =
-                    inframe->given_timestamp +
-                    frames_to_drop_sized; // flush all packets up to (and including?) this
-                reset_input_flow_metrics(conn);
-                debug_mutex_unlock(&conn->flush_mutex, 3);
-
+                uint32_t frames_to_drop_sized = local_frames_to_drop;               
+                do_flush(inframe->given_timestamp + frames_to_drop_sized, conn);
               } else if ((sync_error < 0) && ((-sync_error) > filler_length)) {
                 debug(1,
                       "Large negative sync error of: %" PRId64