diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-03 16:47:16 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-03 22:10:44 +0200 |
commit | 4613ffae8a9e2d4281c169078c1d7847536f9f9c (patch) | |
tree | e4ad37b6e446ab505436e72f76e1d8d58e51dc30 | |
parent | d83ef9935cc55fbf5508efa40c35e1dded621157 (diff) | |
download | rockbox-4613ffae8a9e2d4281c169078c1d7847536f9f9c.tar.gz rockbox-4613ffae8a9e2d4281c169078c1d7847536f9f9c.zip |
Remove unnecessary variable and simplify voice-only counting.
Voice-only strings are identified when reading the strings, so there is no
reason to first store that information and then count them later.
Change-Id: Ie6bd2c4bbf5736630e58d06a20739ef527e3cd69
-rw-r--r-- | tools/voicefont.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/voicefont.c b/tools/voicefont.c index 546d0052f4..3b67e97436 100644 --- a/tools/voicefont.c +++ b/tools/voicefont.c | |||
@@ -91,15 +91,13 @@ int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output) | |||
91 | char mp3filename2[1024]; | 91 | char mp3filename2[1024]; |
92 | char* mp3filename; | 92 | char* mp3filename; |
93 | FILE* pMp3File; | 93 | FILE* pMp3File; |
94 | int target_id; | ||
95 | int do_bitswap_audio = 0; | 94 | int do_bitswap_audio = 0; |
96 | 95 | ||
97 | 96 | ||
98 | /* We bitswap the voice file only SH based archos players, target IDs | 97 | /* We bitswap the voice file only SH based archos players, target IDs |
99 | equal to or lower than 8. See the target_id line for each target in | 98 | equal to or lower than 8. See the "Target id:" line in rockbox-info.txt |
100 | configure */ | 99 | or the target_id value in configure. */ |
101 | target_id = targetnum; | 100 | if (targetnum <= 8) |
102 | if (target_id <= 8) | ||
103 | do_bitswap_audio = 1; | 101 | do_bitswap_audio = 1; |
104 | 102 | ||
105 | memset(voiceonly, 0, sizeof(voiceonly)); | 103 | memset(voiceonly, 0, sizeof(voiceonly)); |
@@ -112,10 +110,13 @@ int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output) | |||
112 | fields = sscanf(line, " id: %s", name); | 110 | fields = sscanf(line, " id: %s", name); |
113 | if (fields == 1) | 111 | if (fields == 1) |
114 | { | 112 | { |
115 | count++; /* next entry started */ | 113 | strcpy(names[count], name); |
116 | strcpy(names[count-1], name); | ||
117 | if (strncmp("VOICE_", name, 6) == 0) /* voice-only id? */ | 114 | if (strncmp("VOICE_", name, 6) == 0) /* voice-only id? */ |
118 | voiceonly[count-1] = 1; | 115 | { |
116 | count_voiceonly++; | ||
117 | voiceonly[count] = 1; | ||
118 | } | ||
119 | count++; /* next entry started */ | ||
119 | continue; | 120 | continue; |
120 | } | 121 | } |
121 | } | 122 | } |
@@ -125,9 +126,6 @@ int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output) | |||
125 | 126 | ||
126 | for (i=0; i<count; i++) | 127 | for (i=0; i<count; i++) |
127 | { | 128 | { |
128 | if (voiceonly[i] == 1) | ||
129 | count_voiceonly++; | ||
130 | |||
131 | pos[i] = ftell(output); | 129 | pos[i] = ftell(output); |
132 | sprintf(mp3filename1, "%s%s.mp3", filedir, names[i]); | 130 | sprintf(mp3filename1, "%s%s.mp3", filedir, names[i]); |
133 | sprintf(mp3filename2, "%s%s.wav.mp3", filedir, names[i]); | 131 | sprintf(mp3filename2, "%s%s.wav.mp3", filedir, names[i]); |