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
pull/7/head
Sean Bright 9 years ago
parent dc948163ca
commit 675e058e77

@ -47,7 +47,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -67,7 +67,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -126,7 +126,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -53,7 +53,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -59,7 +59,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, GSM_FRAME_SIZE, s->f)) != GSM_FRAME_SIZE) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), GSM_FRAME_SIZE, res); ast_format_get_name(s->fr.subclass.format), GSM_FRAME_SIZE, res);
} }

@ -87,7 +87,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -79,7 +79,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -51,7 +51,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -86,7 +86,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -47,7 +47,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -47,7 +47,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -41,7 +41,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -47,7 +47,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -394,7 +394,7 @@ 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 ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res); ast_format_get_name(s->fr.subclass.format), s->fr.datalen, res);
} }

@ -424,7 +424,7 @@ 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 ((res = fread(msdata, 1, MSGSM_FRAME_SIZE, s->f)) != MSGSM_FRAME_SIZE) {
if (feof(s->f)) { if (feof(s->f)) {
if (res) { if (res) {
ast_log(LOG_WARNING, "Incomplete frame data at end of %s file " ast_debug(3, "Incomplete frame data at end of %s file "
"(expected %d bytes, read %d)\n", "(expected %d bytes, read %d)\n",
ast_format_get_name(s->fr.subclass.format), MSGSM_FRAME_SIZE, res); ast_format_get_name(s->fr.subclass.format), MSGSM_FRAME_SIZE, res);
} }

Loading…
Cancel
Save