summaryrefslogtreecommitdiff
path: root/formats/format_g723.c
diff options
context:
space:
mode:
Diffstat (limited to 'formats/format_g723.c')
-rw-r--r--formats/format_g723.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/formats/format_g723.c b/formats/format_g723.c
index fff6ed07b..a88d132d9 100644
--- a/formats/format_g723.c
+++ b/formats/format_g723.c
@@ -40,7 +40,7 @@
static struct ast_frame *g723_read(struct ast_filestream *s, int *whennext)
{
unsigned short size;
- int res;
+ size_t res;
int delay;
/* Read the delay for the next packet, and schedule again if necessary */
/* XXX is this ignored ? */
@@ -65,15 +65,10 @@ static struct ast_frame *g723_read(struct ast_filestream *s, int *whennext)
/* Read the data into the buffer */
AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, size);
if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
- 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), s->fr.datalen, 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), s->fr.datalen, res,
+ strerror(errno));
}
return NULL;
}