From 675e058e7794f15a4729093a165a0a66abb5d9f9 Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Tue, 2 May 2017 12:34:24 -0400 Subject: cleanup: Change severity of fread short-read warning Many sound files don't have a full frame's worth of data at EOF, so the warning messages were a bit too noisy. So we demote them to debug messages. Change-Id: I6b617467d687658adca39170a81797a11cc766f6 --- formats/format_g719.c | 6 +++--- formats/format_g723.c | 6 +++--- formats/format_g726.c | 6 +++--- formats/format_g729.c | 6 +++--- formats/format_gsm.c | 6 +++--- formats/format_h263.c | 6 +++--- formats/format_h264.c | 6 +++--- formats/format_ilbc.c | 6 +++--- formats/format_pcm.c | 6 +++--- formats/format_siren14.c | 6 +++--- formats/format_siren7.c | 6 +++--- formats/format_sln.c | 6 +++--- formats/format_vox.c | 6 +++--- formats/format_wav.c | 6 +++--- formats/format_wav_gsm.c | 6 +++--- 15 files changed, 45 insertions(+), 45 deletions(-) (limited to 'formats') diff --git a/formats/format_g719.c b/formats/format_g719.c index 572b88f5f..3b2195a30 100644 --- a/formats/format_g719.c +++ b/formats/format_g719.c @@ -47,9 +47,9 @@ static struct ast_frame *g719read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_g723.c b/formats/format_g723.c index d4c4d4b1c..fff6ed07b 100644 --- a/formats/format_g723.c +++ b/formats/format_g723.c @@ -67,9 +67,9 @@ static struct ast_frame *g723_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_g726.c b/formats/format_g726.c index 7da6d1ecb..33f963953 100644 --- a/formats/format_g726.c +++ b/formats/format_g726.c @@ -126,9 +126,9 @@ static struct ast_frame *g726_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_g729.c b/formats/format_g729.c index 4cefc0401..1e523062e 100644 --- a/formats/format_g729.c +++ b/formats/format_g729.c @@ -53,9 +53,9 @@ static struct ast_frame *g729_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_gsm.c b/formats/format_gsm.c index 39deb983e..b737c97e5 100644 --- a/formats/format_gsm.c +++ b/formats/format_gsm.c @@ -59,9 +59,9 @@ static struct ast_frame *gsm_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, GSM_FRAME_SIZE, s->f)) != GSM_FRAME_SIZE) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), GSM_FRAME_SIZE, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), GSM_FRAME_SIZE, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_h263.c b/formats/format_h263.c index d05e59825..586e2d8e5 100644 --- a/formats/format_h263.c +++ b/formats/format_h263.c @@ -87,9 +87,9 @@ static struct ast_frame *h263_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_h264.c b/formats/format_h264.c index 47f71ae6c..9230129e7 100644 --- a/formats/format_h264.c +++ b/formats/format_h264.c @@ -79,9 +79,9 @@ static struct ast_frame *h264_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_ilbc.c b/formats/format_ilbc.c index ec8ad0ffa..8b41ab228 100644 --- a/formats/format_ilbc.c +++ b/formats/format_ilbc.c @@ -51,9 +51,9 @@ static struct ast_frame *ilbc_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_pcm.c b/formats/format_pcm.c index f5ddda9c6..4891f7ed5 100644 --- a/formats/format_pcm.c +++ b/formats/format_pcm.c @@ -86,9 +86,9 @@ static struct ast_frame *pcm_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_siren14.c b/formats/format_siren14.c index d54ed993b..e15e20f46 100644 --- a/formats/format_siren14.c +++ b/formats/format_siren14.c @@ -47,9 +47,9 @@ static struct ast_frame *siren14read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_siren7.c b/formats/format_siren7.c index f3b4b42b3..298992c3c 100644 --- a/formats/format_siren7.c +++ b/formats/format_siren7.c @@ -47,9 +47,9 @@ static struct ast_frame *siren7read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_sln.c b/formats/format_sln.c index 1977f7dc0..5a5cde777 100644 --- a/formats/format_sln.c +++ b/formats/format_sln.c @@ -41,9 +41,9 @@ static struct ast_frame *generic_read(struct ast_filestream *s, int *whennext, u if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_vox.c b/formats/format_vox.c index 195714c6f..c3da4ab94 100644 --- a/formats/format_vox.c +++ b/formats/format_vox.c @@ -47,9 +47,9 @@ static struct ast_frame *vox_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_wav.c b/formats/format_wav.c index 09e6a5313..ce8a8bf0a 100644 --- a/formats/format_wav.c +++ b/formats/format_wav.c @@ -394,9 +394,9 @@ static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext) if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c index bfec903d0..8d7d87f65 100644 --- a/formats/format_wav_gsm.c +++ b/formats/format_wav_gsm.c @@ -424,9 +424,9 @@ static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext) if ((res = fread(msdata, 1, MSGSM_FRAME_SIZE, s->f)) != MSGSM_FRAME_SIZE) { if (feof(s->f)) { if (res) { - ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " - "(expected %d bytes, read %d)\n", - ast_format_get_name(s->fr.subclass.format), MSGSM_FRAME_SIZE, res); + ast_debug(3, "Incomplete frame data at end of %s file " + "(expected %d bytes, read %d)\n", + ast_format_get_name(s->fr.subclass.format), MSGSM_FRAME_SIZE, res); } } else { ast_log(LOG_ERROR, "Error while reading %s file: %s\n", -- cgit v1.2.3