From a03728789611bab7cec1b74f8b6e814ed0c8021b Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 21 Nov 2009 22:35:40 +0200 Subject: [PATCH] Allow setting the playback rate from configuration --- src/input/input.c | 6 +++++- src/libvlc-module.c | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/input/input.c b/src/input/input.c index 02be3663c2..03d172ffeb 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -346,7 +346,11 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item, p_input->p->title = NULL; p_input->p->i_title_offset = p_input->p->i_seekpoint_offset = 0; p_input->p->i_state = INIT_S; - p_input->p->i_rate = INPUT_RATE_DEFAULT; + p_input->p->i_rate = INPUT_RATE_DEFAULT + / var_CreateGetFloat( p_input, "rate" ); + /* Currently, the input rate variable is an integer. So we need to destroy + * the float variable inherited from the configuration. */ + var_Destroy( p_input, "rate" ); p_input->p->b_recording = false; memset( &p_input->p->bookmark, 0, sizeof(p_input->p->bookmark) ); TAB_INIT( p_input->p->i_bookmark, p_input->p->pp_bookmark ); diff --git a/src/libvlc-module.c b/src/libvlc-module.c index 6551cc5229..39e2a2f8fc 100644 --- a/src/libvlc-module.c +++ b/src/libvlc-module.c @@ -727,6 +727,10 @@ static const char *const ppsz_clock_descriptions[] = #define INPUT_FAST_SEEK_LONGTEXT N_( \ "Favor speed over precision while seeking" ) +#define INPUT_RATE_TEXT N_("Playback speed") +#define INPUT_RATE_LONGTEXT N_( \ + "This defines the playback speed (nominal speed is 1.0)." ) + #define INPUT_LIST_TEXT N_("Input list") #define INPUT_LIST_LONGTEXT N_( \ "You can give a comma-separated list " \ @@ -1794,6 +1798,8 @@ vlc_module_begin () add_bool( "input-fast-seek", false, NULL, INPUT_FAST_SEEK_TEXT, INPUT_FAST_SEEK_LONGTEXT, false ) change_safe () + add_float( "rate", 1., NULL, + INPUT_RATE_TEXT, INPUT_RATE_LONGTEXT, false ) add_string( "input-list", NULL, NULL, INPUT_LIST_TEXT, INPUT_LIST_LONGTEXT, true ) -- 2.39.2