cleanup: Change severity of fread short-read warning
authorSean Bright <sean.bright@gmail.com>
Tue, 2 May 2017 16:34:24 +0000 (12:34 -0400)
committerSean Bright <sean.bright@gmail.com>
Tue, 2 May 2017 16:36:20 +0000 (11:36 -0500)
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

15 files changed:
formats/format_g719.c
formats/format_g723.c
formats/format_g726.c
formats/format_g729.c
formats/format_gsm.c
formats/format_h263.c
formats/format_h264.c
formats/format_ilbc.c
formats/format_pcm.c
formats/format_siren14.c
formats/format_siren7.c
formats/format_sln.c
formats/format_vox.c
formats/format_wav.c
formats/format_wav_gsm.c

index 572b88f..3b2195a 100644 (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",
index d4c4d4b..fff6ed0 100644 (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",
index 7da6d1e..33f9639 100644 (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",
index 4cefc04..1e52306 100644 (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",
index 39deb98..b737c97 100644 (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",
index d05e598..586e2d8 100644 (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",
index 47f71ae..9230129 100644 (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",
index ec8ad0f..8b41ab2 100644 (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",
index f5ddda9..4891f7e 100644 (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",
index d54ed99..e15e20f 100644 (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",
index f3b4b42..298992c 100644 (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",
index 1977f7d..5a5cde7 100644 (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",
index 195714c..c3da4ab 100644 (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",
index 09e6a53..ce8a8bf 100644 (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",
index bfec903..8d7d87f 100644 (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",