From 67e0b16133168fda24f6bbe5899583e22a37a58a Mon Sep 17 00:00:00 2001 From: waker Date: Thu, 29 Sep 2011 20:42:46 +0200 Subject: fixed aac_read to avoid mp4ff_read_sample calls after EOF --- plugins/aac/aac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/aac') 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 #include #include -#include #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; -- cgit v1.2.3