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
This commit is contained in:
Rafaël Carré 2010-05-15 10:05:47 +00:00
parent 3c74d20462
commit 77ec4b301b

View file

@ -540,7 +540,9 @@ void talk_init(void)
reset_state(); /* use this for most of our inits */ reset_state(); /* use this for most of our inits */
filehandle = open_voicefile(); 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; voicefile_size = 0;
if (has_voicefile) if (has_voicefile)