]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/sout.cpp
Qt/Sout: pass the ttl from the UI to the MRL
[vlc] / modules / gui / qt4 / dialogs / sout.cpp
index 1f512f8d48db41c82d4158beaecbedff1232125b..c7a53fe7893ac470121dde400a83770817e76172 100644 (file)
@@ -34,6 +34,7 @@
 #include <QString>
 #include <QFileDialog>
 #include <QToolButton>
+#include <QSpinBox>
 #include <assert.h>
 
 SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputMRL )
@@ -224,9 +225,12 @@ void SoutDialog::updateMRL()
     for( int i = 1; i < ui.destTab->count(); i++ )
     {
         VirtualDestBox *vdb = qobject_cast<VirtualDestBox *>(ui.destTab->widget( i ));
-        QString tempMRL = vdb->getMRL( qs_mux );
+        if( !vdb )
+            continue;
 
+        QString tempMRL = vdb->getMRL( qs_mux );
         if( tempMRL.isEmpty() ) continue;
+
         if( multi )
             smrl.option( "dst", tempMRL );
         else
@@ -257,8 +261,8 @@ void SoutDialog::updateMRL()
 
         /* FIXME: This sucks. We should really return a QStringList instead of
          * (mis)quoting, concatainating and split input item paramters. */
-        name = name.replace( " ", " " );
-        group = group.replace( " ", " " );
+        name = name.replace( " ", " " );
+        group = group.replace( " ", " " );
 
         /* We need to add options for both standard and rtp targets */
         /* This is inelegant but simple and functional */
@@ -274,7 +278,9 @@ void SoutDialog::updateMRL()
         mrl.append( qfu( " :no-sout-standard-sap" ) );
     }
 
-    if( ui.soutAll->isChecked() )  mrl.append( " :sout-all" );
+    if( ui.soutAll->isChecked() ) mrl.append( " :sout-all" );
+
+    if( ui.ttl->value() != 1 ) mrl.append( " :ttl=" + ui.ttl->value() );
 
     mrl.append( " :sout-keep" );