- msg_Dbg( p_intf, "Sout mrl %s", qta( s->getMrl() ) );
- /* Just do it */
- int i_len = strlen( qtu( s->getMrl() ) ) + 10;
- char *psz_option = (char*)malloc( i_len );
- snprintf( psz_option, i_len - 1, "%s", qtu( s->getMrl() ) );
-
- playlist_AddExt( THEPL, qtu( mrl ), "Streaming",
- PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END,
- -1, &psz_option, 1, true, pl_Unlocked );
+ SoutDialog *s = new SoutDialog( parent, p_intf, mrl );
+ if( s->exec() == QDialog::Accepted )
+ {
+ soutoption = s->getMrl();
+ delete s;
+ }
+ else
+ {
+ delete s; return;
+ }
+ } else {
+ /* Convert */
+ ConvertDialog *s = new ConvertDialog( parent, p_intf, mrl );
+ if( s->exec() == QDialog::Accepted )
+ {
+ soutoption = s->getMrl();
+ delete s;
+ }
+ else
+ {
+ delete s; return;
+ }
+ }
+
+ /* Get SoutMRL */
+ if( !soutoption.isEmpty() )
+ {
+ options += soutoption.split( " :");
+
+ /* Create Input */
+ input_item_t *p_input;
+ p_input = input_item_New( p_intf, qtu( mrl ), _("Streaming") );
+
+ /* Add normal Options */
+ for( int j = 0; j < options.size(); j++ )
+ {
+ QString qs = colon_unescape( options[j] );
+ if( !qs.isEmpty() )
+ {
+ input_item_AddOption( p_input, qtu( qs ),
+ VLC_INPUT_OPTION_TRUSTED );
+ msg_Dbg( p_intf, "Adding option: %s", qtu( qs ) );
+ }
+ }
+
+ /* Switch between enqueuing and starting the item */
+ /* FIXME: playlist_AddInput() can fail */
+ playlist_AddInput( THEPL, p_input,
+ PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, true, pl_Unlocked );
+ vlc_gc_decref( p_input );
+