]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
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:34:24 +0000 (12:34 -0400)
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 b93cf0be6d761695f62c19f71e677e61d9565a43..667858587fc8827d0953ea4156f97af6e399d703 100644 (file)
@@ -49,9 +49,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 5eed3f5c822a473fb48a1e4f4f6f33a2b7fcf209..11821246cc967ab1ce8c248afbe4b5d4f86f2392 100644 (file)
@@ -69,9 +69,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 0455d6dff19a18a4226293f4b86c696954c65d69..94623f441e84e59b6c4b04d58bd5b7d6653f7112 100644 (file)
@@ -128,9 +128,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 fa122d33bd8ab437d51514b7356df981368687a1..04dfbcfdaa7ede7bc831e70114690578327d050d 100644 (file)
@@ -55,9 +55,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 07aba9f19aafc71787e6254c5dbf07e86e404c75..cfc9452ef2c4ba9c7ed2700acd239f08d8aed07e 100644 (file)
@@ -61,9 +61,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 5c23923b75206371d3e8cb574f1a1cae2016762c..5d59972dee08e88d101ec6a7e13b8514451e807e 100644 (file)
@@ -89,9 +89,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 5051fd450970af1f6a29944bcd07cc607f1736d1..f8906f423783a077552691dc3668326580b6b1a3 100644 (file)
@@ -81,9 +81,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 2d67ab244866457c7cd5ed8650f6981d2c3652bb..6e06ef335e57dd52b34468212d194f71a924ce05 100644 (file)
@@ -53,9 +53,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 cc32ca12ff948e0b71cb94a70f5b89c613a50d72..bd7cf777647a87f36cf8786c15111cabb47b311b 100644 (file)
@@ -88,9 +88,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 b35ebce148a405e84a2fc8c1bc350c556a0aff89..5aaa1f130098d838a3ec39ef9d68c3b0b55771b0 100644 (file)
@@ -49,9 +49,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 c7856b2a7558a2fd849cdc46ec4fc456e6a7cdc1..87e1372b3857cf735012d84b3c2f90e3bb900c4a 100644 (file)
@@ -49,9 +49,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 aa47bde565e674f39b09800c81c2492a116335a1..2f4cc57ea6c3cc6bf80ca95451cdc09d85c89c66 100644 (file)
@@ -43,9 +43,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 e4d1e378bdd29f9bb3f07a375fa909dadedabee7..26d4169e1c9f3ce7480ec343c873c9752bd49061 100644 (file)
@@ -49,9 +49,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 81807c11ad138f9f5ffdbd01fd0e1acf2a3f1f8b..2903992ab1d8d20678ef536192c7d3f267c382ae 100644 (file)
@@ -396,9 +396,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 f11b27277dc7ca00c02393c61848d7225e5f26e3..2f80a9a46784219053e19fa45bfd8996ffff50d9 100644 (file)
@@ -426,9 +426,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",