vlc | branch: master | Jean-Baptiste Kempf <[email protected]> | Wed Dec 21 
20:23:24 2016 +0100| [fb706bcc9f061c614ce68150bfe0f6f19a6cd9b6] | committer: 
Jean-Baptiste Kempf

NSSpeech: do not silently call objectAtIndexedSubscript and 
objectForKeyedSubscript

Signed-off-by: Jean-Baptiste Kempf <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fb706bcc9f061c614ce68150bfe0f6f19a6cd9b6
---

 modules/text_renderer/nsspeechsynthesizer.m | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/text_renderer/nsspeechsynthesizer.m 
b/modules/text_renderer/nsspeechsynthesizer.m
index 3651ddf..32d2512 100644
--- a/modules/text_renderer/nsspeechsynthesizer.m
+++ b/modules/text_renderer/nsspeechsynthesizer.m
@@ -139,14 +139,14 @@ static int RenderText(filter_t *p_filter,
                     NSRange range = NSMakeRange(0, 2);
 
                     for (NSUInteger i = 0; i < count; i++) {
-                        NSDictionary *voiceAttributes = [NSSpeechSynthesizer 
attributesForVoice:voices[i]];
-                        NSString *voiceLanguage = 
voiceAttributes[@"VoiceLanguage"];
+                        NSDictionary *voiceAttributes = [NSSpeechSynthesizer 
attributesForVoice: [voices objectAtIndex:i]];
+                        NSString *voiceLanguage = [voiceAttributes 
objectForKey:@"VoiceLanguage"];
                         if ([p_sys->currentLocale 
isEqualToString:[voiceLanguage substringWithRange:range]]) {
-                            NSString *voiceName = 
voiceAttributes[@"VoiceName"];
+                            NSString *voiceName = [voiceAttributes 
objectForKey:@"VoiceName"];
                             msg_Dbg(p_filter, "switched to voice '%s'", 
[voiceName UTF8String]);
                             if ([voiceName isEqualToString:@"Agnes"] || 
[voiceName isEqualToString:@"Albert"])
                                 continue;
-                            [p_sys->speechSynthesizer setVoice:voices[i]];
+                            [p_sys->speechSynthesizer setVoice: [voices 
objectAtIndex:i]];
                             break;
                         }
                     }

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to