Commit f49d3582 authored by Prince Gupta's avatar Prince Gupta 💬 Committed by Hugo Beauzée-Luyssen
Browse files

libvlc-module: add 'save-recentplay' option

parent 4427da15
......@@ -123,4 +123,7 @@ void input_ConfigVarInit ( input_thread_t *p_input )
/* Inherited by demux/subtitle.c */
var_Create( p_input, "sub-original-fps", VLC_VAR_FLOAT );
/* used by Medialibrary */
var_Create( p_input, "save-recentplay", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
}
......@@ -709,6 +709,8 @@ static const char *const ppsz_prefres[] = {
"the form \"{name=bookmark-name,time=optional-time-offset," \
"bytes=optional-byte-offset},{...}\"")
#define SAVE_RECENTPLAY N_("Save recently played items")
#define RESTORE_PLAYBACK_POS_TEXT N_("Continue playback")
#define RESTORE_PLAYBACK_POS_LONGTEXT N_("Should the playback resume where " \
"it was left off?")
......@@ -1866,6 +1868,8 @@ vlc_module_begin ()
BOOKMARKS_TEXT, BOOKMARKS_LONGTEXT )
change_safe ()
add_bool( "save-recentplay", true, SAVE_RECENTPLAY, NULL );
add_integer( "restore-playback-pos", VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK,
RESTORE_PLAYBACK_POS_TEXT, RESTORE_PLAYBACK_POS_LONGTEXT )
change_integer_list( pi_restore_playback_values, ppsz_restore_playback_desc );
......
......@@ -202,7 +202,8 @@ vlc_player_UpdateMLStates(vlc_player_t *player, struct vlc_player_input* input)
}
assert(media->i_type != VLC_ML_MEDIA_TYPE_UNKNOWN);
vlc_ml_media_update_progress( ml, media->i_id, input->position );
if ( var_GetBool( input->thread, "save-recentplay" ) )
vlc_ml_media_update_progress( ml, media->i_id, input->position );
/* If the value changed during the playback, update it in the medialibrary.
* If not, set each state to their "unset" values, so that they aren't saved
......
Supports Markdown
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