diff options
author | waker <wakeroid@gmail.com> | 2011-09-29 20:42:46 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-09-29 20:42:46 +0200 |
commit | 67e0b16133168fda24f6bbe5899583e22a37a58a (patch) | |
tree | 11168bbe02a3bedfe5d50b5909a76673ed720bc6 /plugins/aac | |
parent | dc25cec68337330d8d40de84c8081d07184ee519 (diff) |
fixed aac_read to avoid mp4ff_read_sample calls after EOF
Diffstat (limited to 'plugins/aac')
-rw-r--r-- | plugins/aac/aac.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/aac/aac.c b/plugins/aac/aac.c index 5416c924..f42b9d2f 100644 --- a/plugins/aac/aac.c +++ b/plugins/aac/aac.c @@ -21,7 +21,6 @@ #include <stdio.h> #include <unistd.h> #include <neaacdec.h> -#include <assert.h> #ifdef HAVE_CONFIG_H #include "../../config.h" #endif @@ -694,6 +693,10 @@ aac_free (DB_fileinfo_t *_info) { static int aac_read (DB_fileinfo_t *_info, char *bytes, int size) { aac_info_t *info = (aac_info_t *)_info; + if (info->eof) { + trace ("aac_read: received call after eof\n"); + return 0; + } int samplesize = _info->fmt.channels * _info->fmt.bps / 8; if (!info->file->vfs->is_streaming ()) { if (info->currentsample + size / samplesize > info->endsample) { @@ -815,7 +818,6 @@ aac_read (DB_fileinfo_t *_info, char *bytes, int size) { unsigned char *buffer = NULL; int buffer_size = 0; #ifdef USE_MP4FF - assert (!info->eof); int rc = mp4ff_read_sample (info->mp4file, info->mp4track, info->mp4sample, &buffer, &buffer_size); if (rc == 0) { info->eof = 1; |