diff --git a/src/htsp_server.c b/src/htsp_server.c index 7e5d8c0d..3d0eb9cf 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -267,6 +267,10 @@ htsp_flush_queue(htsp_connection_t *htsp, htsp_msg_q_t *hmq) TAILQ_REMOVE(&hmq->hmq_q, hm, hm_link); htsp_msg_destroy(hm); } + + // reset + hmq->hmq_length = 0; + hmq->hmq_payload = 0; pthread_mutex_unlock(&htsp->htsp_out_mutex); } @@ -2434,6 +2438,11 @@ htsp_subscription_skip(htsp_subscription_t *hs, streaming_skip_t *skip) htsmsg_t *m = htsmsg_create_map(); htsmsg_add_str(m, "method", "subscriptionSkip"); htsmsg_add_u32(m, "subscriptionId", hs->hs_sid); + + /* Flush pkt buffers */ + if (skip->type != SMT_SKIP_ERROR) + htsp_flush_queue(hs->hs_htsp, &hs->hs_q); + if (skip->type == SMT_SKIP_ABS_TIME || skip->type == SMT_SKIP_ABS_SIZE) htsmsg_add_u32(m, "absolute", 1); if (skip->type == SMT_SKIP_ERROR) diff --git a/src/timeshift/timeshift_reader.c b/src/timeshift/timeshift_reader.c index 1e9e5483..1f9e739b 100644 --- a/src/timeshift/timeshift_reader.c +++ b/src/timeshift/timeshift_reader.c @@ -545,7 +545,7 @@ void *timeshift_reader ( void *p ) /* Convert */ skip_time = ts_rescale(skip->time, 1000000); - tvhlog(LOG_DEBUG, "timeshift", "ts %d skip %"PRId64" requested", ts->id, skip->time); + tvhlog(LOG_DEBUG, "timeshift", "ts %d skip %"PRId64" requested %"PRId64, ts->id, skip_time, skip->time); /* Live playback (stage1) */ if (ts->state == TS_LIVE) { @@ -562,7 +562,8 @@ void *timeshift_reader ( void *p ) /* May have failed */ if (skip) { - tvhlog(LOG_DEBUG, "timeshift", "ts %d skip last_time %"PRId64, ts->id, last_time); + tvhlog(LOG_DEBUG, "timeshift", "ts %d skip last_time %"PRId64" pts_delta %"PRId64, + ts->id, last_time, ts->pts_delta); skip_time += (skip->type == SMT_SKIP_ABS_TIME) ? ts->pts_delta : last_time; /* Live (stage2) */