]> 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:36:13 +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 62e8c40c39abe293e4e320c027e775233ef9aff2..bc374ee4501ad607de01ffe847c62580fb041e50 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 79d241b12e5d4f8c75fd41931f1e2470286dff6b..22e39927a3e8f202f313ab8ff8e1d44fd8774f86 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 b2d34e6fe1ae103429245c521177e92f3301d4a2..4d5a91a8f6961586fbaaf9b8d8a1bb5f5f274472 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 f1bc79e675989a09cdf4d469e8d5ced0f62b28d4..44a466fac936438877d113eec1db279aa6b2fef5 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 12074b7611e03f967dbbe8941a1910038e091fd7..7e7c54da3849575ac467ea550c6fdfd5452a8ab5 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 d008d61cdf2b106ae2e7099a192a8234ffb385d8..a3ca933462c09e6c4ae9533b7f9e2b9ee383d63d 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 1b62e492c5d4919f3f142f0391b4c9321e4d0a23..b89e8ec81791727d8375040e05d4aab4d30ac1fb 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 ff88d50059d1346612ea3af1ba27587d2fb63d8f..3103611c0ca8cc266b809f8a69e8fbb2fad08ae9 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 b2cd20dad9444a8a221c89eb6756d80d99836a80..705a03530f6e2da6817e580b7b2826d2cfc76450 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 1f013d21cb80c71bdb280de97f6109c2323f9085..15cbe4cfd605e5083cec9c439783ff59e0417145 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 38c7512b533d17be82119eba32861abe7d215c35..ff0bca3b48821f32c526a1ed9adff18e8db02f91 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 dff25d1a70274068ad7480eb388a90397947c1c2..f68becb0f3b6f739ca91ef7a228765de0ea8cd67 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 94b37bf3cc0a0643ceebdb3c60303d2da5f70c4f..fc840530f3ca271e4e25e2c8490a611315e2fd47 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 63df6357cdffdeaf1174be3895bb1ae5369264af..85a22ed8a47355bd95fb4aa220c15ccfc9224013 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 049cecaaf778b3806c5918adbeeb803b926ef485..e480179dd1d751e21bc4754b5ff9f1f1b237855f 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",