Commit 7d8c4743 authored by Antoine Cellerier's avatar Antoine Cellerier

Add option to force timeshift filter even if access can control pace or pause.

The goal is to be able to timeshift on live rtsp streams. The true fix would be to fix the rtsp access ...
parent 1f09d331
...@@ -48,6 +48,9 @@ static void Close( vlc_object_t * ); ...@@ -48,6 +48,9 @@ static void Close( vlc_object_t * );
#define DIR_TEXT N_("Timeshift directory") #define DIR_TEXT N_("Timeshift directory")
#define DIR_LONGTEXT N_( "Directory used to store the timeshift temporary " \ #define DIR_LONGTEXT N_( "Directory used to store the timeshift temporary " \
"files." ) "files." )
#define FORCE_TEXT N_("Force use of the timeshift module")
#define FORCE_LONGTEXT N_("Force use of the timeshift module even if the " \
"access declares that it can control pace or pause." )
vlc_module_begin(); vlc_module_begin();
set_shortname( _("Timeshift") ); set_shortname( _("Timeshift") );
...@@ -61,6 +64,8 @@ vlc_module_begin(); ...@@ -61,6 +64,8 @@ vlc_module_begin();
add_integer( "timeshift-granularity", 50, NULL, GRANULARITY_TEXT, add_integer( "timeshift-granularity", 50, NULL, GRANULARITY_TEXT,
GRANULARITY_LONGTEXT, VLC_TRUE ); GRANULARITY_LONGTEXT, VLC_TRUE );
add_directory( "timeshift-dir", 0, 0, DIR_TEXT, DIR_LONGTEXT, VLC_FALSE ); add_directory( "timeshift-dir", 0, 0, DIR_TEXT, DIR_LONGTEXT, VLC_FALSE );
add_bool( "timeshift-force", VLC_FALSE, NULL, FORCE_TEXT, FORCE_LONGTEXT,
VLC_FALSE );
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
...@@ -113,10 +118,19 @@ static int Open( vlc_object_t *p_this ) ...@@ -113,10 +118,19 @@ static int Open( vlc_object_t *p_this )
access_sys_t *p_sys; access_sys_t *p_sys;
vlc_bool_t b_bool; vlc_bool_t b_bool;
var_Create( p_access, "timeshift-force",
VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
if( var_GetBool( p_access, "timeshift-force" ) == VLC_TRUE )
{
msg_Dbg( p_access, "Forcing use of timeshift even if access can control pace or pause" );
}
else
{
/* Only work with not pace controled access */ /* Only work with not pace controled access */
if( access2_Control( p_src, ACCESS_CAN_CONTROL_PACE, &b_bool ) || b_bool ) if( access2_Control( p_src, ACCESS_CAN_CONTROL_PACE, &b_bool )
|| b_bool )
{ {
msg_Dbg( p_src, "ACCESS_CAN_CONTROL_PACE" ); msg_Dbg( p_src, "ACCESS_CAN_CONTROL_PACE: timeshift useless" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/* Refuse access that can be paused */ /* Refuse access that can be paused */
...@@ -125,6 +139,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -125,6 +139,7 @@ static int Open( vlc_object_t *p_this )
msg_Dbg( p_src, "ACCESS_CAN_PAUSE: timeshift useless" ); msg_Dbg( p_src, "ACCESS_CAN_PAUSE: timeshift useless" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
}
/* */ /* */
p_access->pf_read = NULL; p_access->pf_read = NULL;
......
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