"when you change the above settings,\n but you can update it manually." ) ) ;
// /* Connect everything to the updateMRL function */
- #define CB( x ) CONNECT( ui.x, clicked( bool ), this, updateMRL() );
+ #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() );
#define CT( x ) CONNECT( ui.x, textChanged( const QString ), this, updateMRL() );
#define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() );
#define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() );
if( b_transcode_only ) toggleSout();
}
+QString SoutDialog::getMrl()
+{
+ return this->mrl;
+}
+
void SoutDialog::fileBrowse()
{
ui.tabWidget->setTabEnabled( 0,false );
{
sout_gui_descr_t sout;
memset( &sout, 0, sizeof( sout_gui_descr_t ) );
+ int counter = 0;
sout.b_local = ui.localOutput->isChecked();
sout.b_file = ui.fileOutput->isChecked();
sout.psz_group = strdup( qtu( ui.sapGroup->text() ) );
sout.psz_name = strdup( qtu( ui.sapName->text() ) );
+#define COUNT() \
+{ \
+ if ( sout.b_local ) \
+ counter += 1; \
+ if ( sout.b_file ) \
+ counter += 1; \
+ if ( sout.b_http ) \
+ counter += 1; \
+ if ( sout.b_mms ) \
+ counter += 1; \
+ if ( sout.b_udp ) \
+ counter += 1; \
+}
+
+COUNT()
+
#define SMUX( x, txt ) if( ui.x->isChecked() ) sout.psz_mux = strdup( txt );
SMUX( PSMux, "ps" );
SMUX( TSMux, "ts" );
#define ISMORE() if ( more ) mrl.append( "," );
- if ( trans )
- {
- mrl.append( ":duplicate{" );
+#define ATLEASTONE() \
+ if ( counter > 1 ) \
+ { \
+ mrl.append( "dst=" ); \
}
- else
+
+ if ( trans )
+ {
+ mrl.append( ":" );
+ }
+ else
{
mrl = ":sout=#";
}
+ if ( counter > 1 )
+ {
+ mrl.append( "duplicate{" );
+ }
+
if ( sout.b_local )
{
ISMORE();
- mrl.append( "dst=display" );
+ ATLEASTONE()
+ mrl.append( "display" );
more = true;
}
if ( sout.b_file )
{
ISMORE();
- mrl.append( "dst=std{access=file,mux=" );
+ ATLEASTONE()
+ mrl.append( "std{access=file,mux=" );
mrl.append( sout.psz_mux );
mrl.append( ",dst=" );
mrl.append( sout.psz_file );
if ( sout.b_http )
{
ISMORE();
- mrl.append( "dst=std{access=http,mux=" );
+ ATLEASTONE()
+ mrl.append( "std{access=http,mux=" );
mrl.append( sout.psz_mux );
mrl.append( ",dst=" );
mrl.append( sout.psz_http );
if ( sout.b_mms )
{
ISMORE();
- mrl.append( "dst=std{access=mmsh,mux=" );
+ ATLEASTONE()
+ mrl.append( "std{access=mmsh,mux=" );
mrl.append( sout.psz_mux );
mrl.append( ",dst=" );
mrl.append( sout.psz_mms );
if ( sout.b_udp )
{
ISMORE();
- mrl.append( "dst=std{access=udp,mux=" );
+ ATLEASTONE()
+ mrl.append( "std{access=udp,mux=" );
mrl.append( sout.psz_mux );
mrl.append( ",dst=" );
mrl.append( sout.psz_udp );
more = true;
}
- if ( trans )
+ if ( counter > 1 )
{
mrl.append( "}" );
}
/* Just do it */
int i_len = strlen( qtu(s->mrl) ) + 10;
char *psz_option = (char*)malloc(i_len);
- snprintf( psz_option, i_len - 1, ":sout=%s", qtu(s->mrl));
+ snprintf( psz_option, i_len - 1, "%s", qtu(s->mrl));
playlist_AddExt( THEPL, qtu( mrl ), "Streaming",
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END,