[Asterisk-code-review] cleanup: Change severity of fread short-read warning (asterisk[master])

George Joseph asteriskteam at digium.com
Wed May 3 04:39:40 CDT 2017


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/5575 )

Change subject: cleanup: Change severity of fread short-read warning
......................................................................


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
---
M formats/format_g719.c
M formats/format_g723.c
M formats/format_g726.c
M formats/format_g729.c
M formats/format_gsm.c
M formats/format_h263.c
M formats/format_h264.c
M formats/format_ilbc.c
M formats/format_pcm.c
M formats/format_siren14.c
M formats/format_siren7.c
M formats/format_sln.c
M formats/format_vox.c
M formats/format_wav.c
M formats/format_wav_gsm.c
15 files changed, 45 insertions(+), 45 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved; Approved for Submit
  Richard Mudgett: Looks good to me, but someone else must approve



diff --git a/formats/format_g719.c b/formats/format_g719.c
index 572b88f..3b2195a 100644
--- a/formats/format_g719.c
+++ b/formats/format_g719.c
@@ -47,9 +47,9 @@
 	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",
diff --git a/formats/format_g723.c b/formats/format_g723.c
index d4c4d4b..fff6ed0 100644
--- a/formats/format_g723.c
+++ b/formats/format_g723.c
@@ -67,9 +67,9 @@
 	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",
diff --git a/formats/format_g726.c b/formats/format_g726.c
index 7da6d1e..33f9639 100644
--- a/formats/format_g726.c
+++ b/formats/format_g726.c
@@ -126,9 +126,9 @@
 	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",
diff --git a/formats/format_g729.c b/formats/format_g729.c
index 4cefc04..1e52306 100644
--- a/formats/format_g729.c
+++ b/formats/format_g729.c
@@ -53,9 +53,9 @@
 	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",
diff --git a/formats/format_gsm.c b/formats/format_gsm.c
index 39deb98..b737c97 100644
--- a/formats/format_gsm.c
+++ b/formats/format_gsm.c
@@ -59,9 +59,9 @@
 	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",
diff --git a/formats/format_h263.c b/formats/format_h263.c
index d05e598..586e2d8 100644
--- a/formats/format_h263.c
+++ b/formats/format_h263.c
@@ -87,9 +87,9 @@
 	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",
diff --git a/formats/format_h264.c b/formats/format_h264.c
index 47f71ae..9230129 100644
--- a/formats/format_h264.c
+++ b/formats/format_h264.c
@@ -79,9 +79,9 @@
 	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",
diff --git a/formats/format_ilbc.c b/formats/format_ilbc.c
index ec8ad0f..8b41ab2 100644
--- a/formats/format_ilbc.c
+++ b/formats/format_ilbc.c
@@ -51,9 +51,9 @@
 	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",
diff --git a/formats/format_pcm.c b/formats/format_pcm.c
index f5ddda9..4891f7e 100644
--- a/formats/format_pcm.c
+++ b/formats/format_pcm.c
@@ -86,9 +86,9 @@
 	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",
diff --git a/formats/format_siren14.c b/formats/format_siren14.c
index d54ed99..e15e20f 100644
--- a/formats/format_siren14.c
+++ b/formats/format_siren14.c
@@ -47,9 +47,9 @@
 	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",
diff --git a/formats/format_siren7.c b/formats/format_siren7.c
index f3b4b42..298992c 100644
--- a/formats/format_siren7.c
+++ b/formats/format_siren7.c
@@ -47,9 +47,9 @@
 	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",
diff --git a/formats/format_sln.c b/formats/format_sln.c
index 1977f7d..5a5cde7 100644
--- a/formats/format_sln.c
+++ b/formats/format_sln.c
@@ -41,9 +41,9 @@
 	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",
diff --git a/formats/format_vox.c b/formats/format_vox.c
index 195714c..c3da4ab 100644
--- a/formats/format_vox.c
+++ b/formats/format_vox.c
@@ -47,9 +47,9 @@
 	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",
diff --git a/formats/format_wav.c b/formats/format_wav.c
index 09e6a53..ce8a8bf 100644
--- a/formats/format_wav.c
+++ b/formats/format_wav.c
@@ -394,9 +394,9 @@
 	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",
diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c
index bfec903..8d7d87f 100644
--- a/formats/format_wav_gsm.c
+++ b/formats/format_wav_gsm.c
@@ -424,9 +424,9 @@
 		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",

-- 
To view, visit https://gerrit.asterisk.org/5575
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6b617467d687658adca39170a81797a11cc766f6
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list