Browse Source

TT#46052 rate-limit certain log messages related to de/encoding

closes #625

Change-Id: Ia6e812322129db8be0d242a9ce8c37b730deeb11
changes/26/24726/1
Richard Fuchs 7 years ago
parent
commit
c074319623
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      lib/codeclib.c

+ 5
- 5
lib/codeclib.c View File

@ -587,7 +587,7 @@ static int avc_decoder_input(decoder_t *dec, const str *data, GQueue *out) {
return 0; return 0;
err: err:
ilog(LOG_ERR, "Error decoding media packet: %s", err);
ilog(LOG_ERR | LOG_FLAG_LIMIT, "Error decoding media packet: %s", err);
av_frame_free(&frame); av_frame_free(&frame);
return -1; return -1;
} }
@ -631,7 +631,7 @@ int decoder_input_data(decoder_t *dec, const str *data, unsigned long ts,
while ((frame = g_queue_pop_head(&frames))) { while ((frame = g_queue_pop_head(&frames))) {
AVFrame *rsmp_frame = resample_frame(&dec->resampler, frame, &dec->out_format); AVFrame *rsmp_frame = resample_frame(&dec->resampler, frame, &dec->out_format);
if (!rsmp_frame) { if (!rsmp_frame) {
ilog(LOG_ERR, "Resampling failed");
ilog(LOG_ERR | LOG_FLAG_LIMIT, "Resampling failed");
ret = -1; ret = -1;
} }
else { else {
@ -648,7 +648,7 @@ int decoder_input_data(decoder_t *dec, const str *data, unsigned long ts,
static void avlog_ilog(void *ptr, int loglevel, const char *fmt, va_list ap) { static void avlog_ilog(void *ptr, int loglevel, const char *fmt, va_list ap) {
char *msg; char *msg;
if (vasprintf(&msg, fmt, ap) <= 0) if (vasprintf(&msg, fmt, ap) <= 0)
ilog(LOG_ERR, "av_log message dropped");
ilog(LOG_ERR | LOG_FLAG_LIMIT, "av_log message dropped");
else { else {
#ifdef AV_LOG_PANIC #ifdef AV_LOG_PANIC
// translate AV_LOG_ constants to LOG_ levels // translate AV_LOG_ constants to LOG_ levels
@ -671,7 +671,7 @@ static void avlog_ilog(void *ptr, int loglevel, const char *fmt, va_list ap) {
else else
loglevel = LOG_DEBUG; loglevel = LOG_DEBUG;
#endif #endif
ilog(loglevel, "av_log: %s", msg);
ilog(loglevel | LOG_FLAG_LIMIT, "av_log: %s", msg);
free(msg); free(msg);
} }
} }
@ -1473,7 +1473,7 @@ static int amr_decoder_input(decoder_t *dec, const str *data, GQueue *out) {
err: err:
if (err) if (err)
ilog(LOG_WARN, "Error unpacking AMR packet: %s", err);
ilog(LOG_WARN | LOG_FLAG_LIMIT, "Error unpacking AMR packet: %s", err);
return -1; return -1;
} }


Loading…
Cancel
Save