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
This commit is contained in:
Sean Bright 2017-05-02 12:34:24 -04:00
parent dc948163ca
commit 675e058e77
15 changed files with 45 additions and 45 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",