diff options
Diffstat (limited to 'formats/format_g729.c')
-rw-r--r-- | formats/format_g729.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/formats/format_g729.c b/formats/format_g729.c index 48fee3a23..7d6d1cff0 100644 --- a/formats/format_g729.c +++ b/formats/format_g729.c @@ -48,20 +48,16 @@ ASTERISK_REGISTER_FILE() static struct ast_frame *g729_read(struct ast_filestream *s, int *whennext) { - int res; + size_t res; + /* Send a frame from the file to the appropriate channel */ s->fr.samples = G729A_SAMPLES; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, BUF_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 && res != 10) /* XXX what for ? */ { + 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; } |