update: don't re-read unchanged container files

MPD checks if every flac (possibly other types as well) file contains
cuesheet on every update, which produces unneeded I/O. My music
collection is on NFS share, so it's quite noticeable. IMHO, it
shouldn't re-read unchanged files, so I wrote simple patch to fix it.
This commit is contained in:
Igor Kuzmin 2009-08-19 21:21:29 +02:00 committed by Max Kellermann
parent fd8aa54a90
commit 9d42f4e0ed
2 changed files with 3 additions and 1 deletions

1
NEWS
View File

@ -1,6 +1,7 @@
ver 0.15.3 (2009/??/??) ver 0.15.3 (2009/??/??)
* output: * output:
- fix stuttering due to uninitialized variable - fix stuttering due to uninitialized variable
* update: don't re-read unchanged container files
ver 0.15.2 (2009/08/15) ver 0.15.2 (2009/08/15)

View File

@ -502,7 +502,8 @@ update_regular_file(struct directory *directory,
{ {
struct song* song = songvec_find(&directory->songs, name); struct song* song = songvec_find(&directory->songs, name);
if (plugin->container_scan != NULL) if (!(song != NULL && st->st_mtime == song->mtime) &&
plugin->container_scan != NULL)
{ {
if (update_container_file(directory, name, st, plugin)) if (update_container_file(directory, name, st, plugin))
{ {