1
0
Fork 0
forked from len0rd/rockbox

talk: When no voice file is loaded don't even attempt to load the clip, it's hopeless.

Change-Id: I420155d7f01ca0ea301c0678ac7245d251d365b0
This commit is contained in:
Thomas Martitz 2014-01-27 10:05:48 +01:00
parent 543027564c
commit efc20ec164

View file

@ -908,12 +908,14 @@ int talk_id(int32_t id, bool enqueue)
int32_t unit; int32_t unit;
int decimals; int decimals;
if (!has_voicefile)
return 0; /* no voicefile loaded, not an error -> pretent success */
if (talk_temp_disable_count > 0) if (talk_temp_disable_count > 0)
return -1; /* talking has been disabled */ return -1; /* talking has been disabled */
if (!check_audio_status()) if (!check_audio_status())
return -1; return -1;
if (has_voicefile && (talk_handle <= 0 || index_handle <= 0)) /* reload needed? */ if (talk_handle <= 0 || index_handle <= 0) /* reload needed? */
{ {
int fd = open_voicefile(); int fd = open_voicefile();
if (fd < 0 if (fd < 0