From: Mike Brady Date: Wed, 8 Mar 2017 16:17:35 +0000 (+0000) Subject: Fix a bug to ensure a silent frame is supplied to replace a missing frame. X-Git-Tag: 3.1.d1~1^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbcda67f64674d04de5f8edfa0edfed89c834ae0;p=thirdparty%2Fshairport-sync.git Fix a bug to ensure a silent frame is supplied to replace a missing frame. --- diff --git a/player.c b/player.c index 9faa2031..77092228 100644 --- a/player.c +++ b/player.c @@ -1166,8 +1166,7 @@ static abuf_t *buffer_get_frame(void) { if (!curframe->ready) { // debug(1, "Supplying a silent frame for frame %u", read); missing_packets++; - memset(curframe->data, 0, input_bytes_per_frame * max_frames_per_packet); - curframe->timestamp = 0; + curframe->timestamp = 0; // indicate a silent frame should be substituted } curframe->ready = 0; ab_read = SUCCESSOR(ab_read); @@ -1698,19 +1697,11 @@ static void *player_thread_func(void *arg) { inbuflength = inframe->length; if (inbuf) { play_number++; - // if it's a supplied silent frame, let us know... if (inframe->timestamp == 0) { // debug(1,"Player has a supplied silent frame."); last_seqno_read = (SUCCESSOR(last_seqno_read) & 0xffff); // manage the packet out of sequence minder - if (inbuf == NULL) - debug(1, "NULL inbuf to play -- skipping it."); - else { - if (inbuflength == 0) - debug(1, "empty frame to play -- skipping it (1)."); - else - config.output->play(inbuf, inbuflength); - } + config.output->play(silence, max_frames_per_packet * output_sample_ratio); } else { int enable_dither = 0; @@ -2067,6 +2058,7 @@ static void *player_thread_func(void *arg) { } } } + // mark the frame as finished inframe->timestamp = 0;