/*****************************************************************************
* Preamble
*****************************************************************************/
-#define _GNU_SOURCE
-#include <stdlib.h>
#include <errno.h>
#include "vlc_url.h"
#include <vlc_network.h>
#include <vlc_charset.h>
+#include <vlc_strings.h>
/*****************************************************************************
* Module descriptor
static void Close( vlc_object_t * );
#define HOST_TEXT N_( "RTSP host address" )
-/// \bug [String] extra space
#define HOST_LONGTEXT N_( \
"This defines the address, port and path the RTSP VOD server will listen " \
"on.\nSyntax is address:port/path. The default is to listen on all "\
- "interfaces (address 0.0.0.0), on port 554, with no path.\n To listen " \
+ "interfaces (address 0.0.0.0), on port 554, with no path.\nTo listen " \
"only on the local interface, use \"localhost\" as address." )
#define THROTLE_TEXT N_( "Maximum number of connections" )
vod_sys_t *p_sys = p_vod->p_sys;
/* Stop command thread */
- p_vod->b_die = VLC_TRUE;
+ vlc_object_kill( p_vod );
CommandPush( p_vod, RTSP_CMD_TYPE_NONE, NULL, NULL, 0.0, NULL );
vlc_thread_join( p_vod );
p_media->i_sdp_id = mdate();
p_media->i_sdp_version = 1;
- p_media->i_length = p_item->i_duration;
+ p_media->i_length = input_item_GetDuration( p_item );
vlc_mutex_lock( &p_item->lock );
msg_Dbg( p_vod, "media has %i declared ES", p_item->i_es );
if( httpd_ClientIP( cl, ip ) == NULL )
{
answer->i_status = 500;
- answer->psz_status = strdup( "Internal server error" );
answer->i_body = 0;
answer->p_body = NULL;
break;
( p_vod->p_sys->i_connections >= p_vod->p_sys->i_throttle_users ) )
{
answer->i_status = 503;
- answer->psz_status = strdup( "Too many connections" );
answer->i_body = 0;
answer->p_body = NULL;
break;
if( !p_rtsp )
{
answer->i_status = 454;
- answer->psz_status = strdup( "Unknown session id" );
answer->i_body = 0;
answer->p_body = NULL;
break;
if( !p_rtsp )
{
answer->i_status = 454;
- answer->psz_status = strdup( "Unknown session id" );
answer->i_body = 0;
answer->p_body = NULL;
break;
}
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
answer->i_body = 0;
answer->p_body = NULL;
else /* TODO strstr( psz_transport, "interleaved" ) ) */
{
answer->i_status = 461;
- answer->psz_status = strdup( "Unsupported Transport" );
answer->i_body = 0;
answer->p_body = NULL;
}
if( !psz_playnow )
{
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
answer->i_body = 0;
answer->p_body = NULL;
}
if( !p_rtsp )
{
answer->i_status = 500;
- answer->psz_status = strdup( "Internal server error" );
answer->i_body = 0;
answer->p_body = NULL;
break;
if( psz_sdp != NULL )
{
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
httpd_MsgAdd( answer, "Content-type", "%s", "application/sdp" );
answer->p_body = (uint8_t *)psz_sdp;
else
{
answer->i_status = 500;
- answer->psz_status = strdup( "Internal server error" );
answer->p_body = NULL;
answer->i_body = 0;
}
p_rtsp->b_paused = VLC_TRUE;
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
answer->i_body = 0;
answer->p_body = NULL;
break;
case HTTPD_MSG_TEARDOWN:
/* for now only multicast so easy again */
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
answer->i_body = 0;
answer->p_body = NULL;
case HTTPD_MSG_GETPARAMETER:
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
answer->i_body = 0;
answer->p_body = NULL;
break;
if( httpd_ClientIP( cl, ip ) == NULL )
{
answer->i_status = 500;
- answer->psz_status = strdup( "Internal server error" );
answer->i_body = 0;
answer->p_body = NULL;
break;
( p_vod->p_sys->i_connections >= p_vod->p_sys->i_throttle_users ) )
{
answer->i_status = 503;
- answer->psz_status = strdup( "Too many connections" );
answer->i_body = 0;
answer->p_body = NULL;
break;
if( !p_rtsp )
{
answer->i_status = 454;
- answer->psz_status = strdup( "Unknown session id" );
answer->i_body = 0;
answer->p_body = NULL;
break;
if( !p_rtsp_es )
{
answer->i_status = 500;
- answer->psz_status = strdup( "Internal server error" );
answer->i_body = 0;
answer->p_body = NULL;
break;
TAB_APPEND( p_rtsp->i_es, p_rtsp->es, p_rtsp_es );
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
answer->i_body = 0;
answer->p_body = NULL;
else /* TODO strstr( psz_transport, "interleaved" ) ) */
{
answer->i_status = 461;
- answer->psz_status = strdup( "Unsupported Transport" );
answer->i_body = 0;
answer->p_body = NULL;
}
if( !psz_playnow )
{
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
answer->i_body = 0;
answer->p_body = NULL;
}
case HTTPD_MSG_TEARDOWN:
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
answer->i_body = 0;
answer->p_body = NULL;
p_rtsp->b_paused = VLC_TRUE;
answer->i_status = 200;
- answer->psz_status = strdup( "OK" );
answer->i_body = 0;
answer->p_body = NULL;
break;