[vlc-devel] commit: Dummy: handle sub-second pauses ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Aug 1 16:07:07 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug  1 16:39:28 2009 +0300| [d489cb7f06ef103d3d9efa6aedb139799b73cf91] | committer: Rémi Denis-Courmont 

Dummy: handle sub-second pauses

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d489cb7f06ef103d3d9efa6aedb139799b73cf91
---

 modules/misc/dummy/input.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/misc/dummy/input.c b/modules/misc/dummy/input.c
index af93d53..9f19a4a 100644
--- a/modules/misc/dummy/input.c
+++ b/modules/misc/dummy/input.c
@@ -33,6 +33,7 @@
 #include <vlc_interface.h>
 #include <vlc_access.h>
 #include <vlc_demux.h>
+#include <vlc_charset.h>
 
 #include "dummy.h"
 
@@ -118,6 +119,7 @@ struct demux_sys_t
     /* Used for the pause command */
     mtime_t expiration;
 };
+
 enum
 {
     COMMAND_NOP  = 0,
@@ -139,7 +141,6 @@ int OpenDemux ( vlc_object_t *p_this )
 
     int i_len = strlen( psz_name );
     demux_sys_t *p_sys;
-    int   i_arg;
 
     p_demux->pf_demux   = Demux;
     p_demux->pf_control = DemuxControl;
@@ -164,10 +165,10 @@ int OpenDemux ( vlc_object_t *p_this )
     /* Check for a "vlc://pause:***" command */
     if( i_len > 6 && !strncasecmp( psz_name, "pause:", 6 ) )
     {
-        i_arg = atoi( psz_name + 6 );
-        msg_Info( p_demux, "command `pause %i'", i_arg );
+        double f = us_atof( psz_name + 6 );
+        msg_Info( p_demux, "command `pause %f'", f );
         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;
     }
  




More information about the vlc-devel mailing list