Changeset 7d8c4743aa74a3d5eb574a454f2abc43765b7170

Show
Ignore:
Timestamp:
04/26/06 23:04:47 (2 years ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1146085487 +0000
git-parent:

[1f09d331a4c5def92b66b3d36a3288929bc71b76]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1146085487 +0000
Message:

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 ...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access_filter/timeshift.c

    r2fc1756 r7d8c474  
    4949#define DIR_LONGTEXT N_( "Directory used to store the timeshift temporary " \ 
    5050  "files." ) 
     51#define FORCE_TEXT N_("Force use of the timeshift module") 
     52#define FORCE_LONGTEXT N_("Force use of the timeshift module even if the " \ 
     53  "access declares that it can control pace or pause." ) 
    5154 
    5255vlc_module_begin(); 
     
    6265                 GRANULARITY_LONGTEXT, VLC_TRUE ); 
    6366    add_directory( "timeshift-dir", 0, 0, DIR_TEXT, DIR_LONGTEXT, VLC_FALSE ); 
     67    add_bool( "timeshift-force", VLC_FALSE, NULL, FORCE_TEXT, FORCE_LONGTEXT, 
     68              VLC_FALSE ); 
    6469vlc_module_end(); 
    6570 
     
    114119    vlc_bool_t b_bool; 
    115120 
    116     /* Only work with not pace controled access */ 
    117     if( access2_Control( p_src, ACCESS_CAN_CONTROL_PACE, &b_bool ) || b_bool ) 
    118     { 
    119         msg_Dbg( p_src, "ACCESS_CAN_CONTROL_PACE" ); 
    120         return VLC_EGENERIC; 
    121     } 
    122     /* Refuse access that can be paused */ 
    123     if( access2_Control( p_src, ACCESS_CAN_PAUSE, &b_bool ) || b_bool ) 
    124     { 
    125         msg_Dbg( p_src, "ACCESS_CAN_PAUSE: timeshift useless" ); 
    126         return VLC_EGENERIC; 
     121    var_Create( p_access, "timeshift-force", 
     122                VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); 
     123    if( var_GetBool( p_access, "timeshift-force" ) == VLC_TRUE ) 
     124    { 
     125        msg_Dbg( p_access, "Forcing use of timeshift even if access can control pace or pause" ); 
     126    } 
     127    else 
     128    { 
     129        /* Only work with not pace controled access */ 
     130        if( access2_Control( p_src, ACCESS_CAN_CONTROL_PACE, &b_bool ) 
     131            || b_bool ) 
     132        { 
     133            msg_Dbg( p_src, "ACCESS_CAN_CONTROL_PACE: timeshift useless" ); 
     134            return VLC_EGENERIC; 
     135        } 
     136        /* Refuse access that can be paused */ 
     137        if( access2_Control( p_src, ACCESS_CAN_PAUSE, &b_bool ) || b_bool ) 
     138        { 
     139            msg_Dbg( p_src, "ACCESS_CAN_PAUSE: timeshift useless" ); 
     140            return VLC_EGENERIC; 
     141        } 
    127142    } 
    128143