Browse Source

Revert "cleanup: reduce code duplication with a new function"

This reverts commit 8021528f5e.

Failing on CI/CD.
master
Juho Hiltunen 2 years ago
parent
commit
1de9f4b52c
1 changed files with 32 additions and 25 deletions
  1. 32
    25
      src/libespeak-ng/speech.c

+ 32
- 25
src/libespeak-ng/speech.c View File

#include "voice.h" // for FreeVoiceList, VoiceReset, current_... #include "voice.h" // for FreeVoiceList, VoiceReset, current_...
#include "wavegen.h" // for WavegenFill, WavegenInit, WcmdqUsed #include "wavegen.h" // for WavegenFill, WavegenInit, WcmdqUsed


static espeak_ng_STATUS StatusCreateTerminatedMsg(t_espeak_command *c1, unsigned int *unique_identifier, void *user_data);

unsigned char *outbuf = NULL; unsigned char *outbuf = NULL;
int outbuf_size = 0; int outbuf_size = 0;
unsigned char *out_start; unsigned char *out_start;
*unique_identifier = c1->u.my_text.unique_identifier; *unique_identifier = c1->u.my_text.unique_identifier;
} }


return StatusCreateTerminatedMsg(c1, unique_identifier, user_data);
// Create the "terminated msg" command (same uid)
t_espeak_command *c2 = create_espeak_terminated_msg(*unique_identifier, user_data);

// Try to add these 2 commands (single transaction)
if (c1 && c2) {
espeak_ng_STATUS status = fifo_add_commands(c1, c2);
if (status != ENS_OK) {
delete_espeak_command(c1);
delete_espeak_command(c2);
}
return status;
}

delete_espeak_command(c1);
delete_espeak_command(c2);
return ENOMEM;
#else #else
return sync_espeak_Synth(0, text, position, position_type, end_position, flags, user_data); return sync_espeak_Synth(0, text, position, position_type, end_position, flags, user_data);
#endif #endif
*unique_identifier = c1->u.my_mark.unique_identifier; *unique_identifier = c1->u.my_mark.unique_identifier;
} }


return StatusCreateTerminatedMsg(c1, unique_identifier, user_data);
// Create the "terminated msg" command (same uid)
t_espeak_command *c2 = create_espeak_terminated_msg(*unique_identifier, user_data);

// Try to add these 2 commands (single transaction)
if (c1 && c2) {
espeak_ng_STATUS status = fifo_add_commands(c1, c2);
if (status != ENS_OK) {
delete_espeak_command(c1);
delete_espeak_command(c2);
}
return status;
}

delete_espeak_command(c1);
delete_espeak_command(c2);
return ENOMEM;
#else #else
return sync_espeak_Synth_Mark(0, text, index_mark, end_position, flags, user_data); return sync_espeak_Synth_Mark(0, text, index_mark, end_position, flags, user_data);
#endif #endif
return version_string; return version_string;
} }



#pragma GCC visibility pop #pragma GCC visibility pop


static espeak_ng_STATUS StatusCreateTerminatedMsg(t_espeak_command *c1, unsigned int *unique_identifier, void *user_data) {
// Create the "terminated msg" command (same uid)
t_espeak_command *c2 = create_espeak_terminated_msg(*unique_identifier, user_data);

// Try to add these 2 commands (single transaction)
if (c1 && c2) {
espeak_ng_STATUS status = fifo_add_commands(c1, c2);
if (status != ENS_OK) {
delete_espeak_command(c1);
delete_espeak_command(c2);
}
return status;
}

delete_espeak_command(c1);
delete_espeak_command(c2);
return ENOMEM;
}

Loading…
Cancel
Save