# include "config.h"
#endif
-#include <assert.h>
-
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
#include <vlc_block.h>
+
+
#include <vlc_input.h>
#include <vlc_playlist.h>
-#include <vlc_memory.h>
#if 0 //def HAVE_AVAHI_CLIENT
#include "bonjour.h"
set_description( N_("HTTP stream output") )
set_capability( "sout access", 0 )
set_shortname( "HTTP" )
- add_shortcut( "http" )
- add_shortcut( "https" )
- add_shortcut( "mmsh" )
+ add_shortcut( "http", "https", "mmsh" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_ACO )
add_string( SOUT_CFG_PREFIX "user", "", NULL,
}
#if 0 //def HAVE_AVAHI_CLIENT
- if( config_GetInt(p_this, SOUT_CFG_PREFIX "bonjour") )
+ if( var_InheritBool(p_this, SOUT_CFG_PREFIX "bonjour") )
{
char *psz_txt, *psz_name;
- playlist_t *p_playlist = pl_Hold( p_access );
+ playlist_t *p_playlist = pl_Get( p_access );
char *psz_uri = input_item_GetURI( p_playlist->status.p_item->p_input );
char *psz_newuri = psz_uri;
if( psz_file_name &&
asprintf( &psz_txt, "path=%s", psz_file_name ) == -1 )
{
- pl_Release( p_access );
free( psz_uri );
return VLC_ENOMEM;
}
if( p_sys->p_bonjour == NULL )
msg_Err( p_access, "unable to start requested Bonjour announce" );
- pl_Release( p_access );
}
else
p_sys->p_bonjour = NULL;
p_sys->i_header_allocated = 1024;
p_sys->i_header_size = 0;
- p_sys->p_header = malloc( p_sys->i_header_allocated );
+ p_sys->p_header = xmalloc( p_sys->i_header_allocated );
p_sys->b_header_complete = false;
- if( !p_sys->p_header )
- p_sys->i_header_allocated = 0;
p_access->pf_write = Write;
p_access->pf_seek = Seek;
p_access->pf_control = Control;
- /* XXX Do we deal gracefully with p_sys->p_header == NULL? */
- assert( p_sys->p_header );
-
return VLC_SUCCESS;
}
{
p_sys->i_header_allocated =
p_buffer->i_buffer + p_sys->i_header_size + 1024;
- p_sys->p_header = realloc_or_free( p_sys->p_header,
+ p_sys->p_header = xrealloc( p_sys->p_header,
p_sys->i_header_allocated );
- assert( p_sys->p_header );
}
memcpy( &p_sys->p_header[p_sys->i_header_size],
p_buffer->p_buffer,