From 77ec4b301b32bf1676987fab098194bc23fdf75a Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Sat, 15 May 2010 10:05:47 +0000 Subject: talk_init() : don't try to load the voice file if it won't fit in memory now playback still works if voicing is enabled on the clipv1 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26047 a1c6a512-1295-4272-9138-f99709370657 --- apps/talk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/talk.c b/apps/talk.c index 9f31645ca5..c327487962 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -540,7 +540,9 @@ void talk_init(void) reset_state(); /* use this for most of our inits */ filehandle = open_voicefile(); - has_voicefile = (filehandle >= 0); /* test if we can open it */ + size_t audiobufsz = audiobufend - audiobuf; + /* test if we can open and if it fits in the audiobuffer */ + has_voicefile = filehandle >= 0 && filesize(filehandle) > (off_t)audiobufsz; voicefile_size = 0; if (has_voicefile) -- cgit