/*****************************************************************************
* Preamble
*****************************************************************************/
+#define _GNU_SOURCE
#include <stdlib.h>
#include <errno.h>
case HTTPD_MSG_PLAY:
{
- char *psz_output, *psz_position, ip[NI_MAXNUMERICHOST];
+ char *psz_output, ip[NI_MAXNUMERICHOST];
int i, i_port_audio = 0, i_port_video = 0;
/* for now only multicast so easy */
if( p_rtsp->b_playing )
{
char *psz_position = httpd_MsgGet( query, "Range" );
+ char *psz_scale = httpd_MsgGet( query, "Scale" );
if( psz_position ) psz_position = strstr( psz_position, "npt=" );
- if( psz_position )
+ if( psz_position && !psz_scale )
{
double f_pos;
char *end;
msg_Dbg( p_vod, "seeking request: %s", psz_position );
-
psz_position += 4;
/* FIXME: npt= is not necessarily formatted as a float */
f_pos = us_strtod( psz_position, &end );
}
break;
}
+ if( psz_scale )
+ {
+ double f_scale = 0.0;
+ char *end;
+
+ f_scale = us_strtod( psz_scale, &end );
+ if( end > psz_scale )
+ {
+ f_scale = (f_scale * 30.0);
+ if( psz_scale[0] == '-' ) /* rewind */
+ {
+ msg_Dbg( p_vod, "rewind request: %s", psz_scale );
+ vod_MediaControl( p_vod, p_media, psz_session,
+ VOD_MEDIA_REWIND, f_scale );
+ }
+ else if(psz_scale[0] != '1' ) /* fast-forward */
+ {
+ msg_Dbg( p_vod, "fastforward request: %s", psz_scale );
+ vod_MediaControl( p_vod, p_media, psz_session,
+ VOD_MEDIA_FORWARD, f_scale );
+ }
+
+ if( p_rtsp->b_paused == VLC_TRUE )
+ {
+ p_rtsp->b_paused = VLC_FALSE;
+ vod_MediaControl( p_vod, p_media, psz_session,
+ VOD_MEDIA_PAUSE, psz_output );
+ }
+ }
+ break;
+ }
}
if( p_rtsp->b_playing && p_rtsp->b_paused )
sizeof( "i=*\r\n" ) + strlen( p_media->psz_session_description ) +
sizeof( "u=*\r\n" ) + strlen( p_media->psz_session_url ) +
sizeof( "e=*\r\n" ) + strlen( p_media->psz_session_email ) +
+ sizeof( "c=IN IP4 0.0.0.0\r\n" ) + 20 + 10 +
sizeof( "t=0 0\r\n" ) + /* FIXME */
sizeof( "a=tool:"PACKAGE_STRING"\r\n" ) +
- sizeof( "c=IN IP4 0.0.0.0\r\n" ) + 20 + 10 +
sizeof( "a=range:npt=0-1000000000.000\r\n" );
psz_control = (ipv == '6') ? p_media->psz_rtsp_control_v6
if( *p_media->psz_session_email )
p += sprintf( p, "e=%s\r\n", p_media->psz_session_email );
+ p += sprintf( p, "c=IN IP%c %s\r\n", ipv, ipv == '6' ? "::" : "0.0.0.0" );
p += sprintf( p, "t=0 0\r\n" ); /* FIXME */
p += sprintf( p, "a=tool:"PACKAGE_STRING"\r\n" );
- p += sprintf( p, "c=IN IP%c %s\r\n", ipv, ipv == '6' ? "::" : "0.0.0.0" );
-
if( p_media->i_length > 0 )
{
lldiv_t d = lldiv( p_media->i_length / 1000, 1000 );
- p += sprintf( p, "a=range:npt=0-"I64Fd".%03u\r\n", d.quot,
+ p += sprintf( p, "a=range:npt=0-%lld.%03u\r\n", d.quot,
(unsigned)d.rem );
}