RTP thread priority increase

This commit is contained in:
philippe44
2019-08-25 00:56:28 -07:00
parent c44c31f6d4
commit 8a6295a016
2 changed files with 5 additions and 5 deletions

View File

@@ -201,7 +201,7 @@ rtp_resp_t rtp_init(struct in_addr host, int latency, char *aeskey, char *aesiv,
bool rc = true; bool rc = true;
rtp_t *ctx = calloc(1, sizeof(rtp_t)); rtp_t *ctx = calloc(1, sizeof(rtp_t));
rtp_resp_t resp = { 0, 0, 0, NULL }; rtp_resp_t resp = { 0, 0, 0, NULL };
if (!ctx) return resp; if (!ctx) return resp;
ctx->host = host; ctx->host = host;
@@ -263,7 +263,7 @@ rtp_resp_t rtp_init(struct in_addr host, int latency, char *aeskey, char *aesiv,
if (rc) { if (rc) {
ctx->running = true; ctx->running = true;
#ifdef WIN32 #ifdef WIN32
pthread_create(&ctx->rtp_thread, NULL, rtp_thread_func, (void *) ctx); pthread_create(&ctx->rtp_thread, NULL, rtp_thread_func, (void *) ctx);
#else #else
xTaskCreate((TaskFunction_t) rtp_thread_func, "RTP_thread", 4096, ctx, CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT + 1 , &ctx->rtp_thread); xTaskCreate((TaskFunction_t) rtp_thread_func, "RTP_thread", 4096, ctx, CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT + 1 , &ctx->rtp_thread);
#endif #endif
@@ -375,7 +375,7 @@ static void alac_decode(rtp_t *ctx, s16_t *dest, char *buf, int len, int *outsiz
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void alac_decode(rtp_t *ctx, s16_t *dest, char *buf, int len, int *outsize) { static void alac_decode(rtp_t *ctx, s16_t *dest, char *buf, int len, int *outsize) {
unsigned char iv[16]; unsigned char iv[16];
int aeslen; int aeslen;
assert(len<=MAX_PACKET); assert(len<=MAX_PACKET);
if (ctx->decrypt) { if (ctx->decrypt) {
@@ -526,7 +526,7 @@ static void buffer_push_packet(rtp_t *ctx) {
abuf_t *frame = ctx->audio_buffer + BUFIDX(ctx->ab_read + i); abuf_t *frame = ctx->audio_buffer + BUFIDX(ctx->ab_read + i);
if (!frame->ready && now - frame->last_resend > RESEND_TO) { if (!frame->ready && now - frame->last_resend > RESEND_TO) {
rtp_request_resend(ctx, ctx->ab_read + i, ctx->ab_read + i); rtp_request_resend(ctx, ctx->ab_read + i, ctx->ab_read + i);
frame->last_resend = now; frame->last_resend = now;
} }
} }

View File

@@ -345,7 +345,7 @@ void output_init_common(log_level level, const char *device, unsigned output_buf
unsigned i; unsigned i;
loglevel = level; loglevel = level;
output_buf_size = output_buf_size - (output_buf_size % BYTES_PER_FRAME); output_buf_size = output_buf_size - (output_buf_size % BYTES_PER_FRAME);
output.init_size = output_buf_size; output.init_size = output_buf_size;
LOG_DEBUG("outputbuf size: %u", output_buf_size); LOG_DEBUG("outputbuf size: %u", output_buf_size);