0016-lib-save-configuration-after-playback-parse.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From fdaf6ad0b6dc9e1c2a4a9cdd2b5dc92f9c7b6d6d Mon Sep 17 00:00:00 2001
  2. From: Thomas Guillem <thomas@gllm.fr>
  3. Date: Wed, 17 Jan 2018 10:06:13 +0200
  4. Subject: [PATCH 16/18] lib: save configuration after playback/parse
  5. 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...).
  6. ---
  7. lib/media.c | 2 ++
  8. lib/media_player.c | 2 ++
  9. 2 files changed, 4 insertions(+)
  10. diff --git a/lib/media.c b/lib/media.c
  11. index 4bbd979986..f125552fca 100644
  12. --- a/lib/media.c
  13. +++ b/lib/media.c
  14. @@ -579,6 +579,8 @@ void libvlc_media_release( libvlc_media_t *p_md )
  15. libvlc_event_send( &p_md->event_manager, &event );
  16. libvlc_event_manager_destroy( &p_md->event_manager );
  17. + if( p_md->is_parsed )
  18. + config_AutoSaveConfigFile( p_md->p_libvlc_instance->p_libvlc_int );
  19. libvlc_release( p_md->p_libvlc_instance );
  20. free( p_md );
  21. }
  22. diff --git a/lib/media_player.c b/lib/media_player.c
  23. index 4b41ce5e13..9eedaf4af0 100644
  24. --- a/lib/media_player.c
  25. +++ b/lib/media_player.c
  26. @@ -992,6 +992,8 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi )
  27. vlc_player_TogglePause(player);
  28. vlc_player_Unlock(player);
  29. +
  30. + config_AutoSaveConfigFile( p_mi );
  31. }
  32. /**************************************************************************
  33. --
  34. 2.21.1 (Apple Git-122.3)