Commit b6961e16 authored by Felix Paul Kühne's avatar Felix Paul Kühne

osx-wizard: fixed a couple of UTF8-bugs which prevented the proper naming of non-ascii output files

additionally, the wizard now remembers the last selected encap format correctly
parent f2f052e2
/***************************************************************************** /*****************************************************************************
* wizard.m: MacOS X Streaming Wizard * wizard.m: MacOS X Streaming Wizard
***************************************************************************** *****************************************************************************
* Copyright (C) 2005-2007 the VideoLAN team * Copyright (C) 2005-2008 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Felix Kühne <fkuehne@users.sf.net> * Authors: Felix Kühne <fkuehne@users.sf.net>
...@@ -559,8 +559,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -559,8 +559,7 @@ static VLCWizard *_o_sharedInstance = nil;
if( p_item->i_children <= 0 ) if( p_item->i_children <= 0 )
{ {
char *psz_uri = input_item_GetURI( p_item->p_input ); char *psz_uri = input_item_GetURI( p_item->p_input );
[tempArray addObject: [NSString stringWithUTF8String: [tempArray addObject: [NSString stringWithUTF8String: psz_uri]];
psz_uri]];
free( psz_uri ); free( psz_uri );
stop = NO; stop = NO;
} }
...@@ -713,6 +712,9 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -713,6 +712,9 @@ static VLCWizard *_o_sharedInstance = nil;
[o_userSelections setObject:@"NO" forKey:@"trnscdAudio"]; [o_userSelections setObject:@"NO" forKey:@"trnscdAudio"];
} }
/* store the currently selected item for further reference */
int i_temp = [[o_t5_matrix_encap selectedCell] tag];
/* disable all encap-formats */ /* disable all encap-formats */
[[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO]; [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO];
[[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:NO]; [[o_t5_matrix_encap cellAtRow:1 column:0] setEnabled:NO];
...@@ -1050,6 +1052,9 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1050,6 +1052,9 @@ static VLCWizard *_o_sharedInstance = nil;
} }
if (anythingEnabled == YES) if (anythingEnabled == YES)
{ {
/* re-select the previously chosen item, if available */
[o_t5_matrix_encap selectCellWithTag: i_temp];
/* go the encap-tab */ /* go the encap-tab */
[o_tab_pageHolder selectTabViewItemAtIndex:4]; [o_tab_pageHolder selectTabViewItemAtIndex:4];
} else { } else {
...@@ -1470,10 +1475,9 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1470,10 +1475,9 @@ static VLCWizard *_o_sharedInstance = nil;
if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"]) if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"])
{ {
[o_trnscdCmd appendString: @"transcode{"]; [o_trnscdCmd appendString: @"transcode{"];
[o_trnscdCmd appendFormat: @"vcodec=%s,vb=%i", [[[o_videoCodecs [o_trnscdCmd appendFormat: @"vcodec=%@,vb=%i",
objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] [[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdVideoCodec"] intValue]] objectAtIndex:1],
intValue]] objectAtIndex:1] UTF8String], [[o_userSelections [[o_userSelections objectForKey:@"trnscdVideoBitrate"] intValue]];
objectForKey:@"trnscdVideoBitrate"] intValue]];
if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"]) if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"])
{ {
[o_trnscdCmd appendString: @","]; [o_trnscdCmd appendString: @","];
...@@ -1498,21 +1502,20 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1498,21 +1502,20 @@ static VLCWizard *_o_sharedInstance = nil;
/* in case we transcode the audio only, add this */ /* in case we transcode the audio only, add this */
[o_trnscdCmd appendString: @"transcode{"]; [o_trnscdCmd appendString: @"transcode{"];
} }
[o_trnscdCmd appendFormat: @"acodec=%s,ab=%i}:", [[[o_audioCodecs [o_trnscdCmd appendFormat: @"acodec=%@,ab=%i}:",
objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] [[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey:@"trnscdAudioCodec"] intValue]] objectAtIndex:1],
intValue]] objectAtIndex:1] UTF8String], [[o_userSelections [[o_userSelections objectForKey:@"trnscdAudioBitrate"] intValue]];
objectForKey:@"trnscdAudioBitrate"] intValue]];
} }
if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"trnscd"]) if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"trnscd"])
{ {
/* we are just transcoding and dumping the stuff to a file */ /* we are just transcoding and dumping the stuff to a file */
[o_opts_string appendFormat: [o_opts_string appendFormat:
@":sout=#%s%sstandard{mux=%s,dst=%s,access=file}", [o_duplicateCmd @":sout=#%@%@standard{mux=%@,dst=%@,access=file}",
UTF8String], [o_trnscdCmd UTF8String], [[[o_encapFormats o_duplicateCmd,
objectAtIndex: [[o_userSelections objectForKey:@"encapFormat"] o_trnscdCmd,
intValue]] objectAtIndex:0] UTF8String], [[[o_userSelections [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey:@"encapFormat"] intValue]] objectAtIndex:0],
objectForKey: @"trnscdFilePath"] objectAtIndex: x] UTF8String]]; [[o_userSelections objectForKey: @"trnscdFilePath"] objectAtIndex: x]];
} }
else else
{ {
...@@ -1528,31 +1531,28 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1528,31 +1531,28 @@ static VLCWizard *_o_sharedInstance = nil;
} }
else else
{ {
[o_sap_option appendFormat: @"sap,name=\"%s\"", [o_sap_option appendFormat: @"sap,name=\"%@\"",
[[o_userSelections objectForKey:@"sapText"] UTF8String]]; [o_userSelections objectForKey:@"sapText"]];
} }
if( [[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] == @"rtp" ) if( [[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] == @"rtp" )
{ {
/* RTP is no access out, but a stream out module */ /* RTP is no access out, but a stream out module */
[o_opts_string appendFormat: [o_opts_string appendFormat:
@":sout=#%s%srtp{mux=%s,dst=%s,%s}", @":sout=#%@%@rtp{mux=%@,dst=%@,%@}",
[o_duplicateCmd UTF8String], [o_trnscdCmd UTF8String], o_duplicateCmd, o_trnscdCmd,
[[[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0] [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0],
UTF8String], [o_userSelections objectForKey: @"stmgDest"],
[[o_userSelections objectForKey: @"stmgDest"] UTF8String], o_sap_option];
[o_sap_option UTF8String]];
} }
else else
{ {
[o_opts_string appendFormat: [o_opts_string appendFormat:
@":sout=#%s%sstandard{mux=%s,dst=%s,access=%s,%s}", @":sout=#%@%@standard{mux=%@,dst=%@,access=%@,%@}",
[o_duplicateCmd UTF8String], [o_trnscdCmd UTF8String], o_duplicateCmd, o_trnscdCmd,
[[[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0] [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0],
UTF8String], [o_userSelections objectForKey: @"stmgDest"],
[[o_userSelections objectForKey: @"stmgDest"] UTF8String], [[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0],
[[[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] o_sap_option];
UTF8String],
[o_sap_option UTF8String]];
} }
} }
else else
...@@ -1562,24 +1562,22 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -1562,24 +1562,22 @@ static VLCWizard *_o_sharedInstance = nil;
{ {
/* RTP is different from the other protocols, as it isn't provided through an access out module anymore */ /* RTP is different from the other protocols, as it isn't provided through an access out module anymore */
[o_opts_string appendFormat: [o_opts_string appendFormat:
@":sout=#%s%srtp{mux=%s,dst=%s}", @":sout=#%@%@rtp{mux=%@,dst=%@}",
[o_duplicateCmd UTF8String], o_duplicateCmd,
[o_trnscdCmd UTF8String], o_trnscdCmd,
[[[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0] [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0],
UTF8String], [o_userSelections objectForKey: @"stmgDest"]];
[[o_userSelections objectForKey: @"stmgDest"] UTF8String]];
} }
else else
{ {
/* all other protocols are cool */ /* all other protocols are cool */
[o_opts_string appendFormat: [o_opts_string appendFormat:
@":sout=#%s%sstandard{mux=%s,dst=%s,access=%s}", @":sout=#%@%@standard{mux=%@,dst=%@,access=%@}",
[o_duplicateCmd UTF8String], o_duplicateCmd,
[o_trnscdCmd UTF8String], o_trnscdCmd,
[[[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0] [[o_encapFormats objectAtIndex: [[o_userSelections objectForKey: @"encapFormat"] intValue]] objectAtIndex:0],
UTF8String], [o_userSelections objectForKey: @"stmgDest"],
[[o_userSelections objectForKey: @"stmgDest"] UTF8String], [[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0]];
[[[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] UTF8String]];
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment