1 /*****************************************************************************
2 * stream_output.c : stream output module
3 *****************************************************************************
4 * Copyright (C) 2002-2004 VideoLAN
7 * Authors: Christophe Massiot <massiot@via.ecp.fr>
8 * Laurent Aimar <fenrir@via.ecp.fr>
9 * Eric Petit <titer@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
24 *****************************************************************************/
26 /*****************************************************************************
28 *****************************************************************************/
29 #include <stdlib.h> /* free() */
30 #include <stdio.h> /* sprintf() */
31 #include <string.h> /* strerror() */
39 /*****************************************************************************
41 *****************************************************************************/
42 static void sout_cfg_free( sout_cfg_t * );
44 #define sout_stream_url_to_chain( p, s ) _sout_stream_url_to_chain( VLC_OBJECT(p), s )
45 static char *_sout_stream_url_to_chain( vlc_object_t *, char * );
59 /* mrl_Parse: parse psz_mrl and fill p_mrl */
60 static int mrl_Parse( mrl_t *p_mrl, char *psz_mrl );
61 /* mrl_Clean: clean p_mrl after a call to mrl_Parse */
62 static void mrl_Clean( mrl_t *p_mrl );
64 #define FREE( p ) if( p ) { free( p ); (p) = NULL; }
66 /*****************************************************************************
67 * sout_NewInstance: creates a new stream output instance
68 *****************************************************************************/
69 sout_instance_t *__sout_NewInstance( vlc_object_t *p_parent, char * psz_dest )
71 sout_instance_t *p_sout;
74 if( var_Get( p_parent, "sout-keep", &keep ) < 0 )
76 msg_Warn( p_parent, "cannot get sout-keep value" );
77 keep.b_bool = VLC_FALSE;
79 else if( keep.b_bool )
81 msg_Warn( p_parent, "sout-keep true" );
82 if( ( p_sout = vlc_object_find( p_parent, VLC_OBJECT_SOUT,
85 if( !strcmp( p_sout->psz_sout, psz_dest ) )
87 msg_Warn( p_parent, "sout keep : reusing sout" );
88 msg_Warn( p_parent, "sout keep : you probably want to use "
89 "gather stream_out" );
90 vlc_object_detach( p_sout );
91 vlc_object_attach( p_sout, p_parent );
92 vlc_object_release( p_sout );
97 msg_Warn( p_parent, "sout keep : destroying unusable sout" );
98 sout_DeleteInstance( p_sout );
102 else if( !keep.b_bool )
104 while( ( p_sout = vlc_object_find( p_parent, VLC_OBJECT_SOUT,
107 msg_Warn( p_parent, "sout keep : destroying old sout" );
108 sout_DeleteInstance( p_sout );
112 /* *** Allocate descriptor *** */
113 p_sout = vlc_object_create( p_parent, VLC_OBJECT_SOUT );
116 msg_Err( p_parent, "out of memory" );
120 /* *** init descriptor *** */
121 p_sout->psz_sout = strdup( psz_dest );
122 p_sout->p_meta = NULL;
123 p_sout->i_out_pace_nocontrol = 0;
124 p_sout->p_sys = NULL;
126 vlc_mutex_init( p_sout, &p_sout->lock );
127 if( psz_dest && psz_dest[0] == '#' )
129 p_sout->psz_chain = strdup( &psz_dest[1] );
133 p_sout->psz_chain = sout_stream_url_to_chain( p_sout, psz_dest );
134 msg_Dbg( p_sout, "using sout chain=`%s'", p_sout->psz_chain );
136 p_sout->p_stream = NULL;
138 /* attach it for inherit */
139 vlc_object_attach( p_sout, p_parent );
141 p_sout->p_stream = sout_stream_new( p_sout, p_sout->psz_chain );
143 if( p_sout->p_stream == NULL )
145 msg_Err( p_sout, "stream chained failed for `%s'", p_sout->psz_chain );
147 FREE( p_sout->psz_sout );
148 FREE( p_sout->psz_chain );
150 vlc_object_detach( p_sout );
151 vlc_object_destroy( p_sout );
157 /*****************************************************************************
158 * sout_DeleteInstance: delete a previously allocated instance
159 *****************************************************************************/
160 void sout_DeleteInstance( sout_instance_t * p_sout )
163 vlc_object_detach( p_sout );
165 /* remove the stream out chain */
166 sout_stream_delete( p_sout->p_stream );
168 /* *** free all string *** */
169 FREE( p_sout->psz_sout );
170 FREE( p_sout->psz_chain );
175 vlc_meta_Delete( p_sout->p_meta );
178 vlc_mutex_destroy( &p_sout->lock );
180 /* *** free structure *** */
181 vlc_object_destroy( p_sout );
184 /*****************************************************************************
186 *****************************************************************************/
187 sout_packetizer_input_t *sout_InputNew( sout_instance_t *p_sout,
190 sout_packetizer_input_t *p_input;
192 msg_Dbg( p_sout, "adding a new input" );
194 /* *** create a packetizer input *** */
195 p_input = malloc( sizeof( sout_packetizer_input_t ) );
196 p_input->p_sout = p_sout;
197 p_input->p_fmt = p_fmt;
199 if( p_fmt->i_codec == VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
201 vlc_object_release( p_sout );
205 /* *** add it to the stream chain */
206 vlc_mutex_lock( &p_sout->lock );
207 p_input->id = p_sout->p_stream->pf_add( p_sout->p_stream, p_fmt );
208 vlc_mutex_unlock( &p_sout->lock );
210 if( p_input->id == NULL )
219 /*****************************************************************************
221 *****************************************************************************/
222 int sout_InputDelete( sout_packetizer_input_t *p_input )
224 sout_instance_t *p_sout = p_input->p_sout;
226 msg_Dbg( p_sout, "removing an input" );
228 if( p_input->p_fmt->i_codec != VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
230 vlc_mutex_lock( &p_sout->lock );
231 p_sout->p_stream->pf_del( p_sout->p_stream, p_input->id );
232 vlc_mutex_unlock( &p_sout->lock );
237 return( VLC_SUCCESS);
240 /*****************************************************************************
242 *****************************************************************************/
243 int sout_InputSendBuffer( sout_packetizer_input_t *p_input,
246 sout_instance_t *p_sout = p_input->p_sout;
249 if( p_input->p_fmt->i_codec == VLC_FOURCC( 'n', 'u', 'l', 'l' ) )
251 block_Release( p_buffer );
254 if( p_buffer->i_dts <= 0 )
256 msg_Warn( p_sout, "trying to send non-dated packet to stream output!");
257 block_Release( p_buffer );
261 vlc_mutex_lock( &p_sout->lock );
262 i_ret = p_sout->p_stream->pf_send( p_sout->p_stream,
263 p_input->id, p_buffer );
264 vlc_mutex_unlock( &p_sout->lock );
269 /*****************************************************************************
270 * sout_AccessOutNew: allocate a new access out
271 *****************************************************************************/
272 sout_access_out_t *sout_AccessOutNew( sout_instance_t *p_sout,
273 char *psz_access, char *psz_name )
275 sout_access_out_t *p_access;
278 if( !( p_access = vlc_object_create( p_sout,
279 sizeof( sout_access_out_t ) ) ) )
281 msg_Err( p_sout, "out of memory" );
285 psz_next = sout_cfg_parser( &p_access->psz_access, &p_access->p_cfg,
291 p_access->psz_name = strdup( psz_name ? psz_name : "" );
292 p_access->p_sout = p_sout;
293 p_access->p_sys = NULL;
294 p_access->pf_seek = NULL;
295 p_access->pf_read = NULL;
296 p_access->pf_write = NULL;
297 p_access->p_module = NULL;
298 vlc_object_attach( p_access, p_sout );
301 module_Need( p_access, "sout access", p_access->psz_access, VLC_TRUE );
303 if( !p_access->p_module )
305 free( p_access->psz_access );
306 free( p_access->psz_name );
307 vlc_object_detach( p_access );
308 vlc_object_destroy( p_access );
314 /*****************************************************************************
315 * sout_AccessDelete: delete an access out
316 *****************************************************************************/
317 void sout_AccessOutDelete( sout_access_out_t *p_access )
319 vlc_object_detach( p_access );
320 if( p_access->p_module )
322 module_Unneed( p_access, p_access->p_module );
324 free( p_access->psz_access );
326 sout_cfg_free( p_access->p_cfg );
328 free( p_access->psz_name );
330 vlc_object_destroy( p_access );
333 /*****************************************************************************
335 *****************************************************************************/
336 int sout_AccessOutSeek( sout_access_out_t *p_access, off_t i_pos )
338 return p_access->pf_seek( p_access, i_pos );
341 /*****************************************************************************
343 *****************************************************************************/
344 int sout_AccessOutRead( sout_access_out_t *p_access, block_t *p_buffer )
346 return( p_access->pf_read ?
347 p_access->pf_read( p_access, p_buffer ) : VLC_EGENERIC );
350 /*****************************************************************************
352 *****************************************************************************/
353 int sout_AccessOutWrite( sout_access_out_t *p_access, block_t *p_buffer )
355 return p_access->pf_write( p_access, p_buffer );
358 /*****************************************************************************
359 * sout_MuxNew: create a new mux
360 *****************************************************************************/
361 sout_mux_t * sout_MuxNew( sout_instance_t *p_sout, char *psz_mux,
362 sout_access_out_t *p_access )
367 p_mux = vlc_object_create( p_sout,
368 sizeof( sout_mux_t ) );
371 msg_Err( p_sout, "out of memory" );
375 p_mux->p_sout = p_sout;
376 psz_next = sout_cfg_parser( &p_mux->psz_mux, &p_mux->p_cfg, psz_mux );
381 p_mux->p_access = p_access;
382 p_mux->pf_capacity = NULL;
383 p_mux->pf_addstream = NULL;
384 p_mux->pf_delstream = NULL;
385 p_mux->pf_mux = NULL;
386 p_mux->i_nb_inputs = 0;
387 p_mux->pp_inputs = NULL;
390 p_mux->p_module = NULL;
392 vlc_object_attach( p_mux, p_sout );
395 module_Need( p_mux, "sout mux", p_mux->psz_mux, VLC_TRUE );
397 if( p_mux->p_module == NULL )
399 FREE( p_mux->psz_mux );
401 vlc_object_detach( p_mux );
402 vlc_object_destroy( p_mux );
406 /* *** probe mux capacity *** */
407 if( p_mux->pf_capacity )
410 if( p_mux->pf_capacity( p_mux,
411 SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME, NULL,
412 (void*)&b_answer ) != SOUT_MUX_CAP_ERR_OK )
414 b_answer = VLC_FALSE;
418 msg_Dbg( p_sout, "muxer support adding stream at any time" );
419 p_mux->b_add_stream_any_time = VLC_TRUE;
420 p_mux->b_waiting_stream = VLC_FALSE;
422 if( p_mux->pf_capacity( p_mux,
423 SOUT_MUX_CAP_GET_ADD_STREAM_WAIT, NULL,
424 (void*)&b_answer ) != SOUT_MUX_CAP_ERR_OK )
426 b_answer = VLC_FALSE;
430 msg_Dbg( p_sout, "muxer prefers waiting for all ES before "
432 p_mux->b_waiting_stream = VLC_TRUE;
437 p_mux->b_add_stream_any_time = VLC_FALSE;
438 p_mux->b_waiting_stream = VLC_TRUE;
443 p_mux->b_add_stream_any_time = VLC_FALSE;
444 p_mux->b_waiting_stream = VLC_TRUE;
446 p_mux->i_add_stream_start = -1;
451 /*****************************************************************************
453 *****************************************************************************/
454 void sout_MuxDelete( sout_mux_t *p_mux )
456 vlc_object_detach( p_mux );
457 if( p_mux->p_module )
459 module_Unneed( p_mux, p_mux->p_module );
461 free( p_mux->psz_mux );
463 sout_cfg_free( p_mux->p_cfg );
465 vlc_object_destroy( p_mux );
468 /*****************************************************************************
470 *****************************************************************************/
471 sout_input_t *sout_MuxAddStream( sout_mux_t *p_mux, es_format_t *p_fmt )
473 sout_input_t *p_input;
475 if( !p_mux->b_add_stream_any_time && !p_mux->b_waiting_stream )
477 msg_Err( p_mux, "cannot add a new stream (unsuported while muxing "
478 "for this format)" );
481 if( p_mux->i_add_stream_start < 0 )
483 /* we wait for one second */
484 p_mux->i_add_stream_start = mdate();
487 msg_Dbg( p_mux, "adding a new input" );
489 /* create a new sout input */
490 p_input = malloc( sizeof( sout_input_t ) );
491 p_input->p_sout = p_mux->p_sout;
492 p_input->p_fmt = p_fmt;
493 p_input->p_fifo = block_FifoNew( p_mux->p_sout );
494 p_input->p_sys = NULL;
496 TAB_APPEND( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
497 if( p_mux->pf_addstream( p_mux, p_input ) < 0 )
499 msg_Err( p_mux, "cannot add this stream" );
500 TAB_REMOVE( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
501 block_FifoRelease( p_input->p_fifo );
509 /*****************************************************************************
510 * sout_MuxDeleteStream:
511 *****************************************************************************/
512 void sout_MuxDeleteStream( sout_mux_t *p_mux, sout_input_t *p_input )
516 if( p_mux->b_waiting_stream && p_input->p_fifo->i_depth > 0 )
518 /* We stop waiting, and call the muxer for taking care of the data
519 * before we remove this es */
520 p_mux->b_waiting_stream = VLC_FALSE;
521 p_mux->pf_mux( p_mux );
524 TAB_FIND( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input, i_index );
527 if( p_mux->pf_delstream( p_mux, p_input ) < 0 )
529 msg_Err( p_mux, "cannot del this stream from mux" );
532 /* remove the entry */
533 TAB_REMOVE( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
535 if( p_mux->i_nb_inputs == 0 )
537 msg_Warn( p_mux, "no more input stream for this mux" );
540 block_FifoRelease( p_input->p_fifo );
545 /*****************************************************************************
546 * sout_MuxSendBuffer:
547 *****************************************************************************/
548 void sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
551 block_FifoPut( p_input->p_fifo, p_buffer );
553 if( p_mux->b_waiting_stream )
555 if( p_mux->i_add_stream_start > 0 &&
556 p_mux->i_add_stream_start + (mtime_t)1500000 < mdate() )
558 /* more than 1.5 second, start muxing */
559 p_mux->b_waiting_stream = VLC_FALSE;
566 p_mux->pf_mux( p_mux );
569 /*****************************************************************************
571 *****************************************************************************/
572 static int mrl_Parse( mrl_t *p_mrl, char *psz_mrl )
574 char * psz_dup = strdup( psz_mrl );
575 char * psz_parser = psz_dup;
576 char * psz_access = "";
578 char * psz_name = "";
580 /* *** first parse psz_dest */
581 while( *psz_parser && *psz_parser != ':' )
583 if( *psz_parser == '{' )
585 while( *psz_parser && *psz_parser != '}' )
599 #if defined( WIN32 ) || defined( UNDER_CE )
600 if( psz_parser - psz_dup == 1 )
602 /* msg_Warn( p_sout, "drive letter %c: found in source string",
610 psz_access = psz_way = "";
615 *psz_parser++ = '\0';
617 /* let's skip '//' */
618 if( psz_parser[0] == '/' && psz_parser[1] == '/' )
623 psz_name = psz_parser ;
625 /* Come back to parse the access and mux plug-ins */
626 psz_parser = psz_dup;
633 else if( *psz_parser == '/' )
641 psz_access = psz_parser;
643 while( *psz_parser && *psz_parser != '/' )
645 if( *psz_parser == '{' )
647 while( *psz_parser && *psz_parser != '}' )
662 if( *psz_parser == '/' )
664 *psz_parser++ = '\0';
675 psz_way = psz_parser;
679 p_mrl->psz_access = strdup( psz_access );
680 p_mrl->psz_way = strdup( psz_way );
681 p_mrl->psz_name = strdup( psz_name );
684 return( VLC_SUCCESS );
688 /* mrl_Clean: clean p_mrl after a call to mrl_Parse */
689 static void mrl_Clean( mrl_t *p_mrl )
691 FREE( p_mrl->psz_access );
692 FREE( p_mrl->psz_way );
693 FREE( p_mrl->psz_name );
697 /****************************************************************************
698 ****************************************************************************
702 ****************************************************************************
703 ****************************************************************************/
705 /* create a complete chain */
707 module{option=*:option=*}[:module{option=*:...}]
711 * parse module{options=str, option="str "}:
712 * return a pointer on the rest
713 * XXX: psz_chain is modified
715 #define SKIPSPACE( p ) { while( *p && ( *p == ' ' || *p == '\t' ) ) p++; }
716 #define SKIPTRAILINGSPACE( p, e ) \
717 { while( e > p && ( *(e-1) == ' ' || *(e-1) == '\t' ) ) e--; }
719 /* go accross " " and { } */
720 static char *_get_chain_end( char *str )
728 if( !*p || *p == ',' || *p == '}' ) return p;
730 if( *p != '{' && *p != '"' && *p != '\'' )
736 if( *p == '{' ) c = '}';
744 if( *p == c ) return ++p;
745 else if( *p == '{' && c == '}' ) p = _get_chain_end( p );
751 char *sout_cfg_parser( char **ppsz_name, sout_cfg_t **pp_cfg, char *psz_chain )
753 sout_cfg_t *p_cfg = NULL;
759 if( !p ) return NULL;
763 while( *p && *p != '{' && *p != ':' && *p != ' ' && *p != '\t' ) p++;
765 if( p == psz_chain ) return NULL;
767 *ppsz_name = strndup( psz_chain, p - psz_chain );
785 while( *p && *p != '=' && *p != ',' && *p != '{' && *p != '}' &&
786 *p != ' ' && *p != '\t' ) p++;
788 /* fprintf( stderr, "name=%s - rest=%s\n", psz_name, p ); */
791 fprintf( stderr, "invalid options (empty)" );
795 cfg.psz_name = strndup( psz_name, p - psz_name );
799 if( *p == '=' || *p == '{' )
802 vlc_bool_t b_keep_brackets = (*p == '{');
806 end = _get_chain_end( p );
809 cfg.psz_value = NULL;
813 /* Skip heading and trailing spaces.
814 * This ain't necessary but will avoid simple
821 cfg.psz_value = NULL;
825 if( *p == '\'' || *p == '"' ||
826 ( !b_keep_brackets && *p == '{' ) )
830 if( *(end-1) != '\'' && *(end-1) == '"' )
831 SKIPTRAILINGSPACE( p, end );
833 if( end - 1 <= p ) cfg.psz_value = NULL;
834 else cfg.psz_value = strndup( p, end -1 - p );
838 SKIPTRAILINGSPACE( p, end );
839 if( end <= p ) cfg.psz_value = NULL;
840 else cfg.psz_value = strndup( p, end - p );
849 cfg.psz_value = NULL;
855 p_cfg->p_next = malloc( sizeof( sout_cfg_t ) );
856 memcpy( p_cfg->p_next, &cfg, sizeof( sout_cfg_t ) );
858 p_cfg = p_cfg->p_next;
862 p_cfg = malloc( sizeof( sout_cfg_t ) );
863 memcpy( p_cfg, &cfg, sizeof( sout_cfg_t ) );
878 if( *p == ':' ) return( strdup( p + 1 ) );
883 static void sout_cfg_free( sout_cfg_t *p_cfg )
885 while( p_cfg != NULL )
889 p_next = p_cfg->p_next;
891 FREE( p_cfg->psz_name );
892 FREE( p_cfg->psz_value );
899 void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix,
900 const char **ppsz_options, sout_cfg_t *cfg )
906 /* First, var_Create all variables */
907 for( i = 0; ppsz_options[i] != NULL; i++ )
909 asprintf( &psz_name, "%s%s", psz_prefix, ppsz_options[i] );
911 i_type = config_GetType( p_this, psz_name );
913 var_Create( p_this, psz_name, i_type | VLC_VAR_DOINHERIT );
917 /* Now parse options and set value */
918 if( psz_prefix == NULL ) psz_prefix = "";
923 vlc_bool_t b_yes = VLC_TRUE;
925 if( cfg->psz_name == NULL || *cfg->psz_name == '\0' )
930 for( i = 0; ppsz_options[i] != NULL; i++ )
932 if( !strcmp( ppsz_options[i], cfg->psz_name ) )
936 if( ( !strncmp( cfg->psz_name, "no-", 3 ) &&
937 !strcmp( ppsz_options[i], cfg->psz_name + 3 ) ) ||
938 ( !strncmp( cfg->psz_name, "no", 2 ) &&
939 !strcmp( ppsz_options[i], cfg->psz_name + 2 ) ) )
945 if( ppsz_options[i] == NULL )
947 msg_Warn( p_this, "option %s is unknown", cfg->psz_name );
953 asprintf( &psz_name, "%s%s", psz_prefix, ppsz_options[i] );
955 /* get the type of the variable */
956 i_type = config_GetType( p_this, psz_name );
959 msg_Warn( p_this, "unknown option %s (value=%s)",
960 cfg->psz_name, cfg->psz_value );
963 if( i_type != VLC_VAR_BOOL && cfg->psz_value == NULL )
965 msg_Warn( p_this, "missing value for option %s", cfg->psz_name );
974 case VLC_VAR_INTEGER:
975 val.i_int = strtol( cfg->psz_value ? cfg->psz_value : "0",
979 val.f_float = atof( cfg->psz_value ? cfg->psz_value : "0" );
982 val.psz_string = cfg->psz_value;
985 msg_Warn( p_this, "unhandled config var type" );
986 memset( &val, 0, sizeof( vlc_value_t ) );
989 var_Set( p_this, psz_name, val );
990 msg_Dbg( p_this, "set sout option: %s to %s", psz_name, cfg->psz_value );
1000 * XXX name and p_cfg are used (-> do NOT free them)
1002 sout_stream_t *sout_stream_new( sout_instance_t *p_sout, char *psz_chain )
1004 sout_stream_t *p_stream;
1008 msg_Err( p_sout, "invalid chain" );
1012 p_stream = vlc_object_create( p_sout, sizeof( sout_stream_t ) );
1016 msg_Err( p_sout, "out of memory" );
1020 p_stream->p_sout = p_sout;
1021 p_stream->p_sys = NULL;
1023 p_stream->psz_next =
1024 sout_cfg_parser( &p_stream->psz_name, &p_stream->p_cfg, psz_chain);
1026 msg_Dbg( p_sout, "stream=`%s'", p_stream->psz_name );
1028 vlc_object_attach( p_stream, p_sout );
1030 p_stream->p_module =
1031 module_Need( p_stream, "sout stream", p_stream->psz_name, VLC_TRUE );
1033 if( !p_stream->p_module )
1035 sout_stream_delete( p_stream );
1042 void sout_stream_delete( sout_stream_t *p_stream )
1044 msg_Dbg( p_stream, "destroying chain... (name=%s)", p_stream->psz_name );
1046 vlc_object_detach( p_stream );
1047 if( p_stream->p_module ) module_Unneed( p_stream, p_stream->p_module );
1049 FREE( p_stream->psz_name );
1050 FREE( p_stream->psz_next );
1052 sout_cfg_free( p_stream->p_cfg );
1054 msg_Dbg( p_stream, "destroying chain done" );
1055 vlc_object_destroy( p_stream );
1058 static char *_sout_stream_url_to_chain( vlc_object_t *p_this, char *psz_url )
1061 char *psz_chain, *p;
1063 mrl_Parse( &mrl, psz_url );
1064 p = psz_chain = malloc( 500 + strlen( mrl.psz_way ) +
1065 strlen( mrl.psz_access ) +
1066 strlen( mrl.psz_name ) );
1069 if( config_GetInt( p_this, "sout-display" ) )
1071 p += sprintf( p, "duplicate{dst=display,dst=std{mux=\"%s\","
1072 "access=\"%s\",url=\"%s\"}}",
1073 mrl.psz_way, mrl.psz_access, mrl.psz_name );
1077 p += sprintf( p, "std{mux=\"%s\",access=\"%s\",url=\"%s\"}",
1078 mrl.psz_way, mrl.psz_access, mrl.psz_name );
1082 return( psz_chain );