Commit d489cb7f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Dummy: handle sub-second pauses

parent 56a7b4ba
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <vlc_interface.h> #include <vlc_interface.h>
#include <vlc_access.h> #include <vlc_access.h>
#include <vlc_demux.h> #include <vlc_demux.h>
#include <vlc_charset.h>
#include "dummy.h" #include "dummy.h"
...@@ -118,6 +119,7 @@ struct demux_sys_t ...@@ -118,6 +119,7 @@ struct demux_sys_t
/* Used for the pause command */ /* Used for the pause command */
mtime_t expiration; mtime_t expiration;
}; };
enum enum
{ {
COMMAND_NOP = 0, COMMAND_NOP = 0,
...@@ -139,7 +141,6 @@ int OpenDemux ( vlc_object_t *p_this ) ...@@ -139,7 +141,6 @@ int OpenDemux ( vlc_object_t *p_this )
int i_len = strlen( psz_name ); int i_len = strlen( psz_name );
demux_sys_t *p_sys; demux_sys_t *p_sys;
int i_arg;
p_demux->pf_demux = Demux; p_demux->pf_demux = Demux;
p_demux->pf_control = DemuxControl; p_demux->pf_control = DemuxControl;
...@@ -164,10 +165,10 @@ int OpenDemux ( vlc_object_t *p_this ) ...@@ -164,10 +165,10 @@ int OpenDemux ( vlc_object_t *p_this )
/* Check for a "vlc://pause:***" command */ /* Check for a "vlc://pause:***" command */
if( i_len > 6 && !strncasecmp( psz_name, "pause:", 6 ) ) if( i_len > 6 && !strncasecmp( psz_name, "pause:", 6 ) )
{ {
i_arg = atoi( psz_name + 6 ); double f = us_atof( psz_name + 6 );
msg_Info( p_demux, "command `pause %i'", i_arg ); msg_Info( p_demux, "command `pause %f'", f );
p_sys->i_command = COMMAND_PAUSE; p_sys->i_command = COMMAND_PAUSE;
p_sys->expiration = mdate() + (mtime_t)i_arg * (mtime_t)1000000; p_sys->expiration = mdate() + f * (mtime_t)1000000;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment