]> git.sesse.net Git - vlc/commitdiff
qt4_vlm: fix #3938 (options must be removed from the input)
authorRémi Duraffort <ivoire@videolan.org>
Mon, 26 Jul 2010 20:16:15 +0000 (22:16 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 26 Jul 2010 20:17:12 +0000 (22:17 +0200)
modules/gui/qt4/dialogs/vlm.cpp

index ef02c6c88b33bc3bfa51e1ec3dd61f545dd90586..af8adea71e6b92769de1fa96dd5981f3c9959255 100644 (file)
@@ -672,9 +672,23 @@ void VLMWrapper::EditBroadcast( const QString& name, const QString& input,
     command = "setup \"" + name + "\" inputdel all";
     vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
     vlm_MessageDelete( message );
-    command = "setup \"" + name + "\" input \"" + input + "\"";
-    vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
-    vlm_MessageDelete( message );
+
+    if(!input.isEmpty())
+    {
+        QStringList inputs = input.split(":", QString::SkipEmptyParts);
+
+        command = "setup \"" + name + "\" input \"" + inputs[0].trimmed() + "\"";
+        vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+        vlm_MessageDelete( message );
+
+        for( int i = 1; i < inputs.size(); i++ )
+        {
+            command = "setup \"" + name + "\" option \"" + inputs[i].trimmed() + "\"";
+            vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+            vlm_MessageDelete( message );
+        }
+    }
+
     if( !output.isEmpty() )
     {
         command = "setup \"" + name + "\" output \"" + output + "\"";
@@ -745,9 +759,23 @@ void VLMWrapper::EditVod( const QString& name, const QString& input,
                           const QString& mux )
 {
     vlm_message_t *message;
-    QString command = "setup \"" + name + "\" input \"" + input + "\"";
-    vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
-    vlm_MessageDelete( message );
+    QString command;
+
+    if(!input.isEmpty())
+    {
+        QStringList inputs = input.split(":", QString::SkipEmptyParts);
+
+        command = "setup \"" + name + "\" input \"" + inputs[0].trimmed() + "\"";
+        vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+        vlm_MessageDelete( message );
+
+        for( int i = 1; i < inputs.size(); i++ )
+        {
+            command = "setup \"" + name + "\" option \"" + inputs[i].trimmed() + "\"";
+            vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+            vlm_MessageDelete( message );
+        }
+    }
 
     if( !output.isEmpty() )
     {
@@ -791,9 +819,23 @@ void VLMWrapper::EditSchedule( const QString& name, const QString& input,
                                const QString& mux )
 {
     vlm_message_t *message;
-    QString command = "setup \"" + name + "\" input \"" + input + "\"";
-    vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
-    vlm_MessageDelete( message );
+    QString command;
+
+    if(!input.isEmpty())
+    {
+        QStringList inputs = input.split(":", QString::SkipEmptyParts);
+
+        command = "setup \"" + name + "\" input \"" + inputs[0].trimmed() + "\"";
+        vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+        vlm_MessageDelete( message );
+
+        for( int i = 1; i < inputs.size(); i++ )
+        {
+            command = "setup \"" + name + "\" option \"" + inputs[i].trimmed() + "\"";
+            vlm_ExecuteCommand( p_vlm, qtu( command ), &message );
+            vlm_MessageDelete( message );
+        }
+    }
 
     if( !output.isEmpty() )
     {