Commit 8b671eea authored by Carola Nitz's avatar Carola Nitz

patches: add patches to save dialog answers

parent 465c747e
From 3865597b78cbb84d7b31bb372725d204d456a3f8 Mon Sep 17 00:00:00 2001
From: Thomas Guillem <thomas@gllm.fr>
Date: Wed, 17 Jan 2018 10:06:13 +0200
Subject: [PATCH 1/2] core: expose config_AutoSaveConfigFile
---
include/vlc_configuration.h | 2 ++
src/config/configuration.h | 1 -
src/config/file.c | 1 +
src/libvlccore.sym | 1 +
4 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/vlc_configuration.h b/include/vlc_configuration.h
index 2779e99d17..020db37aca 100644
--- a/include/vlc_configuration.h
+++ b/include/vlc_configuration.h
@@ -109,6 +109,8 @@ VLC_API ssize_t config_GetPszChoices(vlc_object_t *, const char *,
VLC_API int config_SaveConfigFile( vlc_object_t * );
#define config_SaveConfigFile(a) config_SaveConfigFile(VLC_OBJECT(a))
+VLC_API int config_AutoSaveConfigFile( vlc_object_t * );
+#define config_AutoSaveConfigFile(a) config_AutoSaveConfigFile(VLC_OBJECT(a))
VLC_API void config_ResetAll( vlc_object_t * );
#define config_ResetAll(a) config_ResetAll(VLC_OBJECT(a))
diff --git a/src/config/configuration.h b/src/config/configuration.h
index dd02c7f4af..9cdf3c96de 100644
--- a/src/config/configuration.h
+++ b/src/config/configuration.h
@@ -28,7 +28,6 @@ extern "C" {
/* Internal configuration prototypes and structures */
int config_CreateDir( vlc_object_t *, const char * );
-int config_AutoSaveConfigFile( vlc_object_t * );
void config_Free (module_config_t *, size_t);
diff --git a/src/config/file.c b/src/config/file.c
index 6270a6bc9d..9f3b85494c 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -522,6 +522,7 @@ error:
return -1;
}
+#undef config_AutoSaveConfigFile
int config_AutoSaveConfigFile( vlc_object_t *p_this )
{
int ret = 0;
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index a15ba0d923..3f18118c3f 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -44,6 +44,7 @@ block_shm_Alloc
block_Realloc
block_TryRealloc
config_AddIntf
+config_AutoSaveConfigFile
config_ChainCreate
config_ChainDestroy
config_ChainDuplicate
From 3865597b78cbb84d7b31bb372725d204d456a3f8 Mon Sep 17 00:00:00 2001
From: Thomas Guillem <thomas@gllm.fr>
Date: Wed, 17 Jan 2018 10:06:13 +0200
Subject: [PATCH 2/2] lib: save configuration after playback/parse
The configuration is also saved when the libvlc instance is terminated but this
doesn't happen often. Indeed, apps using libvlc will generally hold the libvlc
instance during all its lifetime and won't be able to clean it up in a lot of
case (app killed by OS to free up memory, crashes, reboot, force close...).
---
lib/media.c | 2 ++
lib/media_player.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/lib/media.c b/lib/media.c
index 58881e315f..5380250f9d 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -574,6 +574,8 @@ void libvlc_media_release( libvlc_media_t *p_md )
libvlc_event_send( &p_md->event_manager, &event );
libvlc_event_manager_destroy( &p_md->event_manager );
+ if( p_md->is_parsed )
+ config_AutoSaveConfigFile( p_md->p_libvlc_instance->p_libvlc_int );
libvlc_release( p_md->p_libvlc_instance );
free( p_md );
}
diff --git a/lib/media_player.c b/lib/media_player.c
index 6e00a4547f..3994925212 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -182,6 +182,7 @@ static void release_input_thread( libvlc_media_player_t *p_mi )
/* We owned this one */
input_Stop( p_input_thread );
input_Close( p_input_thread );
+ config_AutoSaveConfigFile( p_mi );
}
/*
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