From 5308208ee47f09c61dae19a5b540110fe118d65c Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 16 May 2019 16:26:57 -0400 Subject: [PATCH] further rate limiting for log messages from libav Change-Id: If19d736df87286559d4d3c0dfdda0a81d6c4d5cc --- lib/codeclib.c | 12 ++++++------ lib/resample.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/codeclib.c b/lib/codeclib.c index f0fa0a61c..28d60e96a 100644 --- a/lib/codeclib.c +++ b/lib/codeclib.c @@ -423,7 +423,7 @@ static const char *avc_decoder_init(decoder_t *dec, const str *fmtp) { int i = avcodec_open2(dec->u.avc.avcctx, codec, NULL); if (i) { - ilog(LOG_ERR, "Error returned from libav: %s", av_error(i)); + ilog(LOG_ERR | LOG_FLAG_LIMIT, "Error returned from libav: %s", av_error(i)); return "failed to open codec context"; } @@ -478,7 +478,7 @@ err: if (ret) decoder_close(ret); if (err) - ilog(LOG_ERR, "Error creating media decoder for codec %s: %s", def->rtpname, err); + ilog(LOG_ERR | LOG_FLAG_LIMIT, "Error creating media decoder for codec %s: %s", def->rtpname, err); return NULL; } @@ -603,7 +603,7 @@ static int avc_decoder_input(decoder_t *dec, const str *data, GQueue *out) { err: ilog(LOG_ERR | LOG_FLAG_LIMIT, "Error decoding media packet: %s", err); if (av_ret) - ilog(LOG_ERR, "Error returned from libav: %s", av_error(av_ret)); + ilog(LOG_ERR | LOG_FLAG_LIMIT, "Error returned from libav: %s", av_error(av_ret)); av_frame_free(&frame); return -1; } @@ -994,7 +994,7 @@ static const char *avc_encoder_init(encoder_t *enc, const str *fmtp) { int i = avcodec_open2(enc->u.avc.avcctx, enc->u.avc.codec, NULL); if (i) { - ilog(LOG_ERR, "Error returned from libav: %s", av_error(i)); + ilog(LOG_ERR | LOG_FLAG_LIMIT, "Error returned from libav: %s", av_error(i)); return "failed to open output context"; } @@ -1159,7 +1159,7 @@ static int avc_encoder_input(encoder_t *enc, AVFrame **frame) { err: if (av_ret) - ilog(LOG_ERR, "Error returned from libav: %s", av_error(av_ret)); + ilog(LOG_ERR | LOG_FLAG_LIMIT, "Error returned from libav: %s", av_error(av_ret)); return -1; } @@ -1646,7 +1646,7 @@ static int bcg729_encoder_input(encoder_t *enc, AVFrame **frame) { return 0; if ((*frame)->nb_samples != 80) { - ilog(LOG_ERR, "bcg729: input %u samples instead of 80", (*frame)->nb_samples); + ilog(LOG_ERR | LOG_FLAG_LIMIT, "bcg729: input %u samples instead of 80", (*frame)->nb_samples); return -1; } diff --git a/lib/resample.c b/lib/resample.c index e4fe40918..3e832c445 100644 --- a/lib/resample.c +++ b/lib/resample.c @@ -86,9 +86,9 @@ resample: err: if (errcode) - ilog(LOG_ERR, "Error resampling: %s (%s)", err, av_error(errcode)); + ilog(LOG_ERR | LOG_FLAG_LIMIT, "Error resampling: %s (%s)", err, av_error(errcode)); else - ilog(LOG_ERR, "Error resampling: %s", err); + ilog(LOG_ERR | LOG_FLAG_LIMIT, "Error resampling: %s", err); resample_shutdown(resample); return NULL; }