- i_arg = atoi( psz_name + 6 );
- msg_Info( p_demux, "command `pause %i'", i_arg );
- p_sys->i_command = COMMAND_PAUSE;
- p_sys->expiration = mdate() + (mtime_t)i_arg * (mtime_t)1000000;
+ msg_Info( p_demux, "command `pause'" );
+
+ p_demux->pf_demux = DemuxHold;
+ p_demux->pf_control = DemuxControl;
+ return VLC_SUCCESS;
+ }
+
+ /* Check for a "vlc://pause:***" command */
+ if( !strncasecmp( psz_name, "pause:", 6 ) )
+ {
+ double f = us_atof( psz_name + 6 );
+ mtime_t length = f * CLOCK_FREQ;
+
+ msg_Info( p_demux, "command `pause %f'", f );
+ if( length == 0 )
+ goto nop; /* avoid division by zero */
+
+ demux_sys_t *p_sys = malloc( sizeof( *p_sys ) );
+ if( p_sys == NULL )
+ return VLC_ENOMEM;
+
+ p_sys->end = mdate() + length;
+ p_sys->length = length;
+
+ p_demux->p_sys = p_sys;
+ p_demux->pf_demux = DemuxPause;
+ p_demux->pf_control = ControlPause;