Ticket #207: video_ts_unspecified_lang.diff
| File video_ts_unspecified_lang.diff, 2.6 kB (added by wazza, 5 months ago) |
|---|
-
SapphireVideoTSParser.m
old new 93 93 94 94 /*! 95 95 * @brief Given the two encoding characters of a language, get the display friendly version 96 * 97 * @return NSString translation of the two character ISO code, or nil if the character 98 * code results in an unspecified language 96 99 */ 97 100 static const NSString *languageFromEncodedChars( const char firstChar, const char secondChar ) 98 101 { … … 291 294 if( vts_AudioIsCommentary( audioAttrs[idx] ) ) 292 295 continue; 293 296 294 const NSMutableString * const audioText = [NSMutableString stringWithString:(NSString *)languageFromEncodedChars(vts_CommonFirstLanguageCode ( audioAttrs[idx] ), 295 vts_CommonSecondLanguageCode( audioAttrs[idx] ) )]; 296 if( vts_AudioIsDTS( audioAttrs[idx] ) ) 297 [audioText appendString:@" - DTS"]; 297 const NSString * const lang = languageFromEncodedChars( vts_CommonFirstLanguageCode ( audioAttrs[idx] ), 298 vts_CommonSecondLanguageCode( audioAttrs[idx] ) ); 298 299 299 if( vts_AudioIsSurround( audioAttrs[idx] ) ) 300 /* Check for unspecified audio */ 301 if( lang != nil ) 300 302 { 301 if ( vts_AudioSupportsDolbyDecoding( audioAttrs[idx] ) ) 302 [audioText appendString:@" Dolby Surround"]; 303 else 304 [audioText appendString:@" Surround"]; 303 const NSMutableString * const audioText = [NSMutableString stringWithString:(NSString *)lang]; 304 if( vts_AudioIsDTS( audioAttrs[idx] ) ) 305 [audioText appendString:@" - DTS"]; 306 307 if( vts_AudioIsSurround( audioAttrs[idx] ) ) 308 { 309 if ( vts_AudioSupportsDolbyDecoding( audioAttrs[idx] ) ) 310 [audioText appendString:@" Dolby Surround"]; 311 else 312 [audioText appendString:@" Surround"]; 313 } 314 315 [audioList addObject:audioText]; 305 316 } 306 307 [audioList addObject:audioText];308 317 } 309 318 310 319 audio = commaSeparatedStringFromCollection( audioList ); … … 335 344 for( idx = 0; idx < numSubpictures; ++idx ) 336 345 { 337 346 if( vts_SubpictureIsSubtitle( subpictureAttrs[idx] ) ) 338 [subtitleList addObject:languageFromEncodedChars(vts_CommonFirstLanguageCode ( subpictureAttrs[idx] ), 339 vts_CommonSecondLanguageCode( subpictureAttrs[idx] ) )]; 347 { 348 const NSString * const lang = languageFromEncodedChars( vts_CommonFirstLanguageCode ( subpictureAttrs[idx] ), 349 vts_CommonSecondLanguageCode( subpictureAttrs[idx] ) ); 350 if( lang != nil ) 351 [subtitleList addObject:lang]; 352 } 340 353 } 341 354 342 355 subtitles = commaSeparatedStringFromCollection( subtitleList );
