Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
f7be7553
Commit
f7be7553
authored
Apr 01, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the config dirty flag global rather than per item
parent
98ade156
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
27 deletions
+9
-27
include/vlc_configuration.h
include/vlc_configuration.h
+0
-1
src/config/configuration.h
src/config/configuration.h
+1
-0
src/config/core.c
src/config/core.c
+4
-3
src/config/file.c
src/config/file.c
+4
-21
src/modules/cache.c
src/modules/cache.c
+0
-2
No files found.
include/vlc_configuration.h
View file @
f7be7553
...
...
@@ -71,7 +71,6 @@ struct module_config_t
char
i_short
;
/* Optional short option name */
/* Misc */
unsigned
b_dirty
:
1
;
/* Dirty flag to indicate a config change */
unsigned
b_advanced
:
1
;
/* Flag to indicate an advanced option */
unsigned
b_internal
:
1
;
/* Flag to indicate option is not to be shown */
unsigned
b_unsaveable
:
1
;
/* Config should not be saved */
...
...
src/config/configuration.h
View file @
f7be7553
...
...
@@ -51,6 +51,7 @@ void config_UnsortConfig (void);
((type) == CONFIG_ITEM_FLOAT)
extern
vlc_rwlock_t
config_lock
;
extern
bool
config_dirty
;
bool
config_IsSafe
(
const
char
*
);
...
...
src/config/core.c
View file @
f7be7553
...
...
@@ -38,6 +38,7 @@
#include "modules/modules.h"
vlc_rwlock_t
config_lock
=
VLC_STATIC_RWLOCK
;
bool
config_dirty
=
false
;
static
inline
char
*
strdupnull
(
const
char
*
src
)
{
...
...
@@ -242,7 +243,7 @@ void config_PutPsz( vlc_object_t *p_this,
vlc_rwlock_wrlock
(
&
config_lock
);
oldstr
=
(
char
*
)
p_config
->
value
.
psz
;
p_config
->
value
.
psz
=
str
;
p_config
->
b
_dirty
=
true
;
config
_dirty
=
true
;
vlc_rwlock_unlock
(
&
config_lock
);
free
(
oldstr
);
...
...
@@ -283,7 +284,7 @@ void config_PutInt( vlc_object_t *p_this, const char *psz_name,
vlc_rwlock_wrlock
(
&
config_lock
);
p_config
->
value
.
i
=
i_value
;
p_config
->
b
_dirty
=
true
;
config
_dirty
=
true
;
vlc_rwlock_unlock
(
&
config_lock
);
}
...
...
@@ -324,7 +325,7 @@ void config_PutFloat( vlc_object_t *p_this,
vlc_rwlock_wrlock
(
&
config_lock
);
p_config
->
value
.
f
=
f_value
;
p_config
->
b
_dirty
=
true
;
config
_dirty
=
true
;
vlc_rwlock_unlock
(
&
config_lock
);
}
...
...
src/config/file.c
View file @
f7be7553
...
...
@@ -540,7 +540,6 @@ int config_SaveConfigFile (vlc_object_t *p_this)
!
modified
,
p_item
->
psz_name
,
"%s"
,
psz_value
?
psz_value
:
""
);
}
p_item
->
b_dirty
=
false
;
}
}
vlc_rwlock_unlock
(
&
config_lock
);
...
...
@@ -606,34 +605,18 @@ error:
int
config_AutoSaveConfigFile
(
vlc_object_t
*
p_this
)
{
int
ret
=
VLC_SUCCESS
;
bool
save
=
false
;
int
ret
=
0
;
assert
(
p_this
);
/* Check if there's anything to save */
module_t
**
list
=
module_list_get
(
NULL
);
vlc_rwlock_rdlock
(
&
config_lock
);
for
(
size_t
i_index
=
0
;
list
[
i_index
]
&&
!
save
;
i_index
++
)
if
(
config_dirty
)
{
module_t
*
p_parser
=
list
[
i_index
];
module_config_t
*
p_item
,
*
p_end
;
if
(
!
p_parser
->
i_config_items
)
continue
;
for
(
p_item
=
p_parser
->
p_config
,
p_end
=
p_item
+
p_parser
->
confsize
;
p_item
<
p_end
&&
!
save
;
p_item
++
)
{
save
=
p_item
->
b_dirty
;
}
}
if
(
save
)
/* Note: this will get the read lock recursively. Ok. */
ret
=
config_SaveConfigFile
(
p_this
);
config_dirty
=
(
ret
!=
0
);
}
vlc_rwlock_unlock
(
&
config_lock
);
module_list_free
(
list
);
return
ret
;
}
src/modules/cache.c
View file @
f7be7553
...
...
@@ -326,8 +326,6 @@ static int CacheLoadConfig( module_t *p_module, FILE *file )
memcpy
(
&
p_module
->
p_config
[
i
].
value
,
&
p_module
->
p_config
[
i
].
orig
,
sizeof
(
p_module
->
p_config
[
i
].
value
));
p_module
->
p_config
[
i
].
b_dirty
=
false
;
if
(
p_module
->
p_config
[
i
].
i_list
)
{
if
(
p_module
->
p_config
[
i
].
ppsz_list
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment