1 /*****************************************************************************
2 * sout.cpp : Stream output dialog ( old-style )
3 ****************************************************************************
4 * Copyright (C) 2007-2008 the VideoLAN team
5 * Copyright (C) 2007 Société des arts technologiques
6 * Copyright (C) 2007 Savoir-faire Linux
10 * Authors: Clément Stenac <zorglub@videolan.org>
11 * Jean-Baptiste Kempf <jb@videolan.org>
12 * Jean-François Massol <jf.massol -at- gmail.com>
13 * Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * ( at your option ) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
28 *****************************************************************************/
34 #include "dialogs/sout.hpp"
37 #include <QFileDialog>
39 struct streaming_account_t
41 char *psz_username; /*< username of account */
42 char *psz_password; /*< password of account */
45 struct sout_gui_descr_t
48 bool b_local; /*< local access module */
49 bool b_file; /*< file access module */
50 bool b_http; /*< http access module */
51 bool b_mms; /*< mms access module */
52 bool b_rtp; /*< rtp access module */
53 bool b_udp; /*< udp access module */
54 bool b_dump; /*< dump access module */
55 bool b_icecast; /*< icecast access module */
57 char *psz_file; /*< filename */
58 char *psz_http; /*< HTTP servername or ipaddress */
59 char *psz_mms; /*< MMS servername or ipaddress */
60 char *psz_rtp; /*< RTP servername or ipaddress */
61 char *psz_udp; /*< UDP servername or ipaddress */
62 char *psz_icecast; /*< Icecast servername or ipaddress*/
64 int32_t i_http; /*< http port number */
65 int32_t i_mms; /*< mms port number */
66 int32_t i_rtp; /*< rtp port number */
67 int32_t i_rtp_audio; /*< rtp port number */
68 int32_t i_rtp_video; /*< rtp port number */
69 int32_t i_udp; /*< udp port number */
70 int32_t i_icecast; /*< icecast port number */
73 char *psz_mux; /*< name of muxer to use in streaming */
76 bool b_soverlay; /*< enable burning overlay in the video */
77 char *psz_vcodec; /*< video codec to use in transcoding */
78 char *psz_acodec; /*< audio codec to use in transcoding */
79 char *psz_scodec; /*< subtitle codec to use in transcoding */
80 int32_t i_vb; /*< video bitrate to use in transcoding */
81 int32_t i_ab; /*< audio bitrate to use in transcoding */
82 int32_t i_channels; /*< number of audio channels to use in transcoding */
83 float f_scale; /*< scaling factor to use in transcoding */
86 bool b_sap; /*< send SAP announcement */
87 bool b_all_es;/*< send all elementary streams from source stream */
88 char *psz_group; /*< SAP Group name */
89 char *psz_name; /*< SAP name */
90 int32_t i_ttl; /*< Time To Live (TTL) for network traversal */
93 char *psz_icecast_mountpoint;/*< path to Icecast mountpoint */
94 struct streaming_account_t sa_icecast; /*< Icecast account information */
97 SoutDialog* SoutDialog::instance = NULL;
99 SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
100 bool _transcode_only ) : QVLCDialog( parent, _p_intf )
102 setWindowTitle( qtr( "Stream Output" ) );
104 b_transcode_only = _transcode_only;
109 changeUDPandRTPmess( false );
111 /* ADD HERE for new profiles */
112 #define ADD_PROFILE( name, shortname ) ui.profileBox->addItem( qtr( name ), QVariant( QString( shortname ) ) );
113 ADD_PROFILE( "Custom" , "Custom" )
114 ADD_PROFILE( "IPod (mp4/aac)", "IPod" )
115 ADD_PROFILE( "XBox", "XBox" )
116 ADD_PROFILE( "Windows (wmv/asf)", "Windows" )
117 ADD_PROFILE( "PSP", "PSP")
118 ADD_PROFILE( "GSM", "GSM" )
120 #define ADD_VCODEC( name, fourcc ) ui.vCodecBox->addItem( name, QVariant( fourcc ) );
121 ADD_VCODEC( "MPEG-1", "mp1v" )
122 ADD_VCODEC( "MPEG-2", "mp2v" )
123 ADD_VCODEC( "MPEG-4", "mp4v" )
124 ADD_VCODEC( "DIVX 1" , "DIV1" )
125 ADD_VCODEC( "DIVX 2" , "DIV2" )
126 ADD_VCODEC( "DIVX 3" , "DIV3" )
127 ADD_VCODEC( "H-263", "H263" )
128 ADD_VCODEC( "H-264", "h264" )
129 ADD_VCODEC( "WMV1", "WMV1" )
130 ADD_VCODEC( "WMV2" , "WMV2" )
131 ADD_VCODEC( "M-JPEG", "MJPG" )
132 ADD_VCODEC( "Theora", "theo" )
134 #define ADD_ACODEC( name, fourcc ) ui.aCodecBox->addItem( name, QVariant( fourcc ) );
135 ADD_ACODEC( "MPEG Audio", "mpga" )
136 ADD_ACODEC( "MP3", "mp3" )
137 ADD_ACODEC( "MPEG 4 Audio ( AAC )", "mp4a" )
138 ADD_ACODEC( "A52/AC-3", "a52" )
139 ADD_ACODEC( "Vorbis", "vorb" )
140 ADD_ACODEC( "Flac", "flac" )
141 ADD_ACODEC( "Speex", "spx" )
142 ADD_ACODEC( "WAV", "s16l" )
143 ADD_ACODEC( "WMA", "wma" )
145 #define ADD_SCALING( factor ) ui.vScaleBox->addItem( factor );
146 ADD_SCALING( "0.25" )
148 ADD_SCALING( "0.75" )
150 ADD_SCALING( "1.25" )
152 ADD_SCALING( "1.75" )
155 ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n"
156 "This is automatically generated "
157 "when you change the above settings,\n"
158 "but you can update it manually." ) ) ;
160 // /* Connect everything to the updateMRL function */
161 #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() );
162 #define CT( x ) CONNECT( ui.x, textChanged( const QString ), this, updateMRL() );
163 #define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() );
164 #define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() );
166 CB( fileOutput ); CB( HTTPOutput ); CB( localOutput );
167 CB( RTPOutput ); CB( MMSHOutput ); CB( rawInput ); CB( UDPOutput );
168 CT( fileEdit ); CT( HTTPEdit ); CT( RTPEdit ); CT( MMSHEdit ); CT( UDPEdit );
169 CT( IcecastEdit ); CT( IcecastMountpointEdit ); CT( IcecastNamePassEdit );
170 CS( HTTPPort ); CS( RTPPort ); CS( RTPPort2 ); CS( MMSHPort ); CS( UDPPort );
172 CC( vCodecBox ); CC( subsCodecBox ); CC( aCodecBox ) ;
173 CB( transcodeVideo ); CB( transcodeAudio ); CB( transcodeSubs );
174 /* CB( sOverlay ); */
175 CS( vBitrateSpin ); CS( aBitrateSpin ); CS( aChannelsSpin ); CC( vScaleBox );
177 CB( PSMux ); CB( TSMux ); CB( MPEG1Mux ); CB( OggMux ); CB( ASFMux );
178 CB( MP4Mux ); CB( MOVMux ); CB( WAVMux ); CB( RAWMux ); CB( FLVMux );
180 CB( soutAll ); CS( ttl ); CT( sapName ); CT( sapGroup );
182 CONNECT( ui.profileBox, activated( const QString & ), this, setOptions() );
183 CONNECT( ui.fileSelectButton, clicked() , this, fileBrowse() );
184 CONNECT( ui.transcodeVideo, toggled( bool ),
185 this, setVTranscodeOptions( bool ) );
186 CONNECT( ui.transcodeAudio, toggled( bool ),
187 this, setATranscodeOptions( bool ) );
188 CONNECT( ui.transcodeSubs, toggled( bool ),
189 this, setSTranscodeOptions( bool ) );
190 CONNECT( ui.rawInput, toggled( bool ), this, setRawOptions( bool ) );
192 okButton = new QPushButton( qtr( "&Stream" ) );
193 QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) );
195 okButton->setDefault( true );
196 ui.acceptButtonBox->addButton( okButton, QDialogButtonBox::AcceptRole );
197 ui.acceptButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
199 BUTTONACT( okButton, ok() );
200 BUTTONACT( cancelButton, cancel() );
202 CONNECT( ui.UDPOutput, toggled( bool ), this, changeUDPandRTPmess( bool ) );
203 CONNECT( ui.RTPOutput, clicked(bool), this, RTPtoggled( bool ) );
205 if( b_transcode_only ) toggleSout();
208 void SoutDialog::fileBrowse()
210 QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file" ), "",
211 qtr( "Containers (*.ps *.ts *.mpg *.ogg *.asf *.mp4 *.mov *.wav *.raw *.flv)" ) );
212 ui.fileEdit->setText( fileName );
216 void SoutDialog::setVTranscodeOptions( bool b_trans )
218 ui.vCodecLabel->setEnabled( b_trans );
219 ui.vCodecBox->setEnabled( b_trans );
220 ui.vBitrateLabel->setEnabled( b_trans );
221 ui.vBitrateSpin->setEnabled( b_trans );
222 ui.vScaleLabel->setEnabled( b_trans );
223 ui.vScaleBox->setEnabled( b_trans );
226 void SoutDialog::setATranscodeOptions( bool b_trans )
228 ui.aCodecLabel->setEnabled( b_trans );
229 ui.aCodecBox->setEnabled( b_trans );
230 ui.aBitrateLabel->setEnabled( b_trans );
231 ui.aBitrateSpin->setEnabled( b_trans );
232 ui.aChannelsLabel->setEnabled( b_trans );
233 ui.aChannelsSpin->setEnabled( b_trans );
236 void SoutDialog::setSTranscodeOptions( bool b_trans )
238 ui.subsCodecBox->setEnabled( b_trans );
239 ui.subsOverlay->setEnabled( b_trans );
242 void SoutDialog::setRawOptions( bool b_raw )
244 ui.localOutput->setEnabled( !b_raw );
245 ui.HTTPOutput->setEnabled( !b_raw );
246 ui.MMSHOutput->setEnabled( !b_raw );
247 ui.UDPOutput->setEnabled( !b_raw );
248 ui.RTPOutput->setEnabled( !b_raw );
249 ui.IcecastOutput->setEnabled( !b_raw );
250 ui.UDPRTPLabel->setEnabled( !b_raw );
253 ui.tabWidget->setDisabled( true );
258 void SoutDialog::setOptions()
260 QString profileString =
261 ui.profileBox->itemData( ui.profileBox->currentIndex() ).toString();
262 msg_Dbg( p_intf, "Profile Used: %s", qta( profileString ));
265 #define setProfile( muxName, hasVideo, vCodecName, hasAudio, aCodecName ) \
267 ui.muxName ##Mux->setChecked( true ); \
269 ui.transcodeAudio->setChecked( hasAudio ); \
270 index = ui.aCodecBox->findText( vCodecName ); \
271 if( index >= 0 ) ui.aCodecBox->setCurrentIndex( index ); \
273 ui.transcodeVideo->setChecked( hasVideo ); \
274 index = ui.aCodecBox->findText( vCodecName ); \
275 if( index >=0 ) ui.vCodecBox->setCurrentIndex( index ); \
278 /* ADD HERE the profiles you want and need */
280 if( profileString == "IPod" ) setProfile( MP4, true, "mp4a", true, "mp4v" )
281 else if( profileString == "XBox" ) setProfile( ASF, true, "wma", true, "WMV2" )
283 /* If the profile is not a custom one, then disable the tabWidget */
284 if ( profileString == "Custom" )
285 ui.tabWidget->setEnabled( true );
287 ui.tabWidget->setDisabled( true );
289 /* Update the MRL !! */
293 void SoutDialog::toggleSout()
295 //Toggle all the streaming options.
296 #define HIDEORSHOW(x) if( b_transcode_only ) x->hide(); else x->show();
297 HIDEORSHOW( ui.HTTPOutput ) ; HIDEORSHOW( ui.RTPOutput ) ; HIDEORSHOW( ui.MMSHOutput ) ; HIDEORSHOW( ui.UDPOutput ) ;
298 HIDEORSHOW( ui.HTTPEdit ) ; HIDEORSHOW( ui.RTPEdit ) ; HIDEORSHOW( ui.MMSHEdit ) ; HIDEORSHOW( ui.UDPEdit ) ;
299 HIDEORSHOW( ui.HTTPLabel ) ; HIDEORSHOW( ui.RTPLabel ) ; HIDEORSHOW( ui.MMSHLabel ) ; HIDEORSHOW( ui.UDPLabel ) ;
300 HIDEORSHOW( ui.HTTPPortLabel ) ; HIDEORSHOW( ui.RTPPortLabel ) ; HIDEORSHOW( ui.MMSHPortLabel ) ; HIDEORSHOW( ui.UDPPortLabel )
301 HIDEORSHOW( ui.HTTPPort ) ; HIDEORSHOW( ui.RTPPort ) ; HIDEORSHOW( ui.MMSHPort ) ; HIDEORSHOW( ui.UDPPort ) ; HIDEORSHOW( ui.RTPPortLabel2 ); HIDEORSHOW( ui.RTPPort2 ); HIDEORSHOW( ui.UDPRTPLabel )
303 HIDEORSHOW( ui.sap ); HIDEORSHOW( ui.sapName );
304 HIDEORSHOW( ui.sapGroup ); HIDEORSHOW( ui.sapGroupLabel );
305 HIDEORSHOW( ui.ttlLabel ); HIDEORSHOW( ui.ttl );
307 HIDEORSHOW( ui.IcecastOutput ); HIDEORSHOW( ui.IcecastEdit );
308 HIDEORSHOW( ui.IcecastNamePassEdit ); HIDEORSHOW( ui.IcecastMountpointEdit );
309 HIDEORSHOW( ui.IcecastPort ); HIDEORSHOW( ui.IcecastLabel );
310 HIDEORSHOW( ui.IcecastPortLabel );
311 HIDEORSHOW( ui.IcecastMountpointLabel ); HIDEORSHOW( ui.IcecastNameLabel );
314 if( b_transcode_only ) okButton->setText( "&Save" );
315 else okButton->setText( "&Stream" );
317 setMinimumHeight( 500 );
318 resize( width(), sizeHint().height() );
321 void SoutDialog::changeUDPandRTPmess( bool b_udp )
323 ui.RTPEdit->setVisible( !b_udp );
324 ui.RTPLabel->setVisible( !b_udp );
325 ui.RTPPort->setVisible( !b_udp );
326 ui.RTPPortLabel->setVisible( !b_udp );
327 ui.UDPEdit->setVisible( b_udp );
328 ui.UDPLabel->setVisible( b_udp );
329 ui.UDPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Audio Port:" ) );
330 ui.RTPPort2->setVisible( !b_udp );
331 ui.RTPPortLabel2->setVisible( !b_udp );
334 void SoutDialog::RTPtoggled( bool b_en )
338 if( ui.RTPPort->value() == ui.UDPPort->value() )
340 ui.UDPPort->setValue( ui.UDPPort->value() + 1 );
343 while( ui.RTPPort2->value() == ui.UDPPort->value() ||
344 ui.RTPPort2->value() == ui.RTPPort->value() )
346 ui.RTPPort2->setValue( ui.RTPPort2->value() + 1 );
349 ui.sap->setEnabled( b_en );
350 ui.RTPLabel->setEnabled( b_en );
351 ui.RTPEdit->setEnabled( b_en );
352 ui.UDPOutput->setEnabled( b_en );
353 ui.UDPEdit->setEnabled( b_en );
354 ui.UDPPort->setEnabled( b_en );
355 ui.UDPPortLabel->setEnabled( b_en );
356 ui.RTPPort2->setEnabled( b_en );
357 ui.RTPPortLabel2->setEnabled( b_en );
360 void SoutDialog::ok()
362 mrl = ui.mrlEdit->text();
366 void SoutDialog::cancel()
372 void SoutDialog::updateMRL()
374 sout_gui_descr_t sout;
375 memset( &sout, 0, sizeof( sout_gui_descr_t ) );
376 unsigned int counter = 0;
378 sout.b_local = ui.localOutput->isChecked();
379 sout.b_file = ui.fileOutput->isChecked();
380 sout.b_http = ui.HTTPOutput->isChecked();
381 sout.b_mms = ui.MMSHOutput->isChecked();
382 sout.b_icecast = ui.IcecastOutput->isChecked();
383 sout.b_rtp = ui.RTPOutput->isChecked();
384 sout.b_udp = ui.UDPOutput->isChecked();
385 sout.b_dump = ui.rawInput->isChecked();
386 sout.b_sap = ui.sap->isChecked();
387 sout.b_all_es = ui.soutAll->isChecked();
388 sout.psz_vcodec = strdup( qtu( ui.vCodecBox->itemData( ui.vCodecBox->currentIndex() ).toString() ) );
389 sout.psz_acodec = strdup( qtu( ui.aCodecBox->itemData( ui.aCodecBox->currentIndex() ).toString() ) );
390 sout.psz_scodec = strdup( qtu( ui.subsCodecBox->itemData( ui.subsCodecBox->currentIndex() ).toString() ) );
391 sout.psz_file = strdup( qtu( ui.fileEdit->text() ) );
392 sout.psz_http = strdup( qtu( ui.HTTPEdit->text() ) );
393 sout.psz_mms = strdup( qtu( ui.MMSHEdit->text() ) );
394 sout.psz_rtp = strdup( qtu( ui.RTPEdit->text() ) );
395 sout.psz_udp = strdup( qtu( ui.UDPEdit->text() ) );
396 sout.psz_icecast = strdup( qtu( ui.IcecastEdit->text() ) );
397 sout.sa_icecast.psz_username = strdup( qtu( ui.IcecastNamePassEdit->text() ) );
398 sout.sa_icecast.psz_password = strdup( qtu( ui.IcecastNamePassEdit->text() ) );
399 sout.psz_icecast_mountpoint = strdup( qtu( ui.IcecastMountpointEdit->text() ) );
400 sout.i_http = ui.HTTPPort->value();
401 sout.i_mms = ui.MMSHPort->value();
402 sout.i_rtp = ui.RTPPort->value();
403 sout.i_rtp_audio = sout.i_udp = ui.UDPPort->value();
404 sout.i_rtp_video = ui.RTPPort2->value();
405 sout.i_icecast = ui.IcecastPort->value();
406 sout.i_ab = ui.aBitrateSpin->value();
407 sout.i_vb = ui.vBitrateSpin->value();
408 sout.i_channels = ui.aChannelsSpin->value();
409 sout.f_scale = atof( qta( ui.vScaleBox->currentText() ) );
410 sout.psz_group = strdup( qtu( ui.sapGroup->text() ) );
411 sout.psz_name = strdup( qtu( ui.sapName->text() ) );
413 if ( sout.b_local ) counter++ ;
414 if ( sout.b_file ) counter++ ;
415 if ( sout.b_http ) counter++ ;
416 if ( sout.b_mms ) counter++ ;
417 if ( sout.b_rtp ) counter++ ;
418 if ( sout.b_udp ) counter ++;
419 if ( sout.b_icecast ) counter ++;
421 #define SMUX( x, txt ) if( ui.x->isChecked() ) sout.psz_mux = strdup( txt );
424 SMUX( MPEG1Mux, "mpeg" );
425 SMUX( OggMux, "ogg" );
426 SMUX( ASFMux, "asf" );
427 SMUX( MP4Mux, "mp4" );
428 SMUX( MOVMux, "mov" );
429 SMUX( WAVMux, "wav" );
430 SMUX( RAWMux, "raw" );
431 SMUX( FLVMux, "flv" );
432 SMUX( MKVMux, "mkv" );
437 if ( ui.transcodeVideo->isChecked() || ui.transcodeAudio->isChecked()
438 && !ui.rawInput->isChecked() /*demuxdump speciality*/ )
440 if ( ui.transcodeVideo->isChecked() )
442 mrl = ":sout=#transcode{";
443 mrl.append( "vcodec=" );
444 mrl.append( sout.psz_vcodec );
447 mrl.append( QString::number( sout.i_vb,10 ) );
449 mrl.append( "scale=" );
450 mrl.append( QString::number( sout.f_scale ) );
454 if ( ui.transcodeAudio->isChecked() )
462 mrl = ":sout=#transcode{";
464 mrl.append( "acodec=" );
465 mrl.append( sout.psz_acodec );
468 mrl.append( QString::number( sout.i_ab,10 ) );
470 mrl.append( "channels=" );
471 mrl.append( QString::number( sout.i_channels,10 ) );
477 /* Special case for demuxdump */
478 if ( sout.b_file && sout.b_dump )
480 mrl = ":demux=dump :demuxdump-file=";
481 mrl.append( sout.psz_file );
486 /* Protocol output */
487 if ( sout.b_local || sout.b_file || sout.b_http ||
488 sout.b_mms || sout.b_rtp || sout.b_udp || sout.b_icecast )
491 #define ISMORE() if ( more ) mrl.append( "," )
492 #define ATLEASTONE() if ( counter ) mrl.append( "dst=" )
497 mrl.append( ",mux=");\
498 mrl.append( sout.psz_mux ); \
507 mrl.append( "duplicate{" );
513 mrl.append( "display" );
521 mrl.append( "std{access=file" );
523 mrl.append( ",dst=" );
524 mrl.append( sout.psz_file );
533 mrl.append( "std{access=http" );
535 mrl.append( ",dst=" );
536 mrl.append( sout.psz_http );
538 mrl.append( QString::number( sout.i_http,10 ) );
547 mrl.append( "std{access=mmsh" );
549 mrl.append( ",dst=" );
550 mrl.append( sout.psz_mms );
552 mrl.append( QString::number( sout.i_mms,10 ) );
563 mrl.append( "std{access=udp" );
565 mrl.append( ",dst=" );
566 mrl.append( sout.psz_udp );
568 mrl.append( QString::number( sout.i_udp,10 ) );
572 mrl.append( "rtp{" );
573 mrl.append( "dst=" );
574 mrl.append( sout.psz_rtp );
576 mrl.append( ",port=" );
577 mrl.append( QString::number( sout.i_rtp,10 ) );
578 if( !sout.psz_mux || strncmp( sout.psz_mux, "ts", 2 ) )
580 mrl.append( ",port-audio=" );
581 mrl.append( QString::number( sout.i_rtp_audio, 10 ) );
582 mrl.append( ",port-video=" );
583 mrl.append( QString::number( sout.i_rtp_video, 10 ) );
590 mrl.append( ",sap," );
591 mrl.append( "group=\"" );
592 mrl.append( sout.psz_group );
594 mrl.append( "name=\"" );
595 mrl.append( sout.psz_name );
607 mrl.append( "std{access=shout,mux=ogg" );
608 mrl.append( ",dst=" );
609 mrl.append( sout.sa_icecast.psz_username );
611 mrl.append( sout.psz_icecast );
613 mrl.append( QString::number( sout.i_icecast, 10 ) );
615 mrl.append( sout.psz_icecast_mountpoint );
629 mrl.append( ":sout-all" );
631 ui.mrlEdit->setText( mrl );
632 free( sout.psz_acodec ); free( sout.psz_vcodec ); free( sout.psz_scodec );
633 free( sout.psz_file );free( sout.psz_http ); free( sout.psz_mms );
634 free( sout.psz_rtp ); free( sout.psz_udp ); free( sout.psz_mux );
635 free( sout.psz_name ); free( sout.psz_group );
636 free( sout.psz_icecast ); free( sout.psz_icecast_mountpoint );
637 free( sout.sa_icecast.psz_password ); free( sout.sa_icecast.psz_username );