summaryrefslogtreecommitdiff
path: root/formats/format_gsm.c
diff options
context:
space:
mode:
Diffstat (limited to 'formats/format_gsm.c')
-rw-r--r--formats/format_gsm.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/formats/format_gsm.c b/formats/format_gsm.c
index b737c97e5..70600b47f 100644
--- a/formats/format_gsm.c
+++ b/formats/format_gsm.c
@@ -53,19 +53,14 @@ static const char gsm_silence[] = /* 33 */
static struct ast_frame *gsm_read(struct ast_filestream *s, int *whennext)
{
- int res;
+ size_t res;
AST_FRAME_SET_BUFFER(&(s->fr), s->buf, AST_FRIENDLY_OFFSET, GSM_FRAME_SIZE);
if ((res = fread(s->fr.data.ptr, 1, GSM_FRAME_SIZE, s->f)) != GSM_FRAME_SIZE) {
- if (feof(s->f)) {
- if (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",
- ast_format_get_name(s->fr.subclass.format), strerror(errno));
+ if (res) {
+ ast_log(LOG_WARNING, "Short read of %s data (expected %d bytes, read %zu): %s\n",
+ ast_format_get_name(s->fr.subclass.format), GSM_FRAME_SIZE, res,
+ strerror(errno));
}
return NULL;
}