aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi1979@googlemail.com>2009-08-24 22:14:22 +0200
committerMax Kellermann <max@duempel.org>2009-08-24 22:14:22 +0200
commit408f723701526926a2eba3435a079f0a91b0df66 (patch)
treea620d9589b76afa870cad2889c9dd3e4fc8c0cf8
parent9d42f4e0ed81969b4fcf1c20e60e867a2defe636 (diff)
downloadmpd-408f723701526926a2eba3435a079f0a91b0df66.tar.gz
mpd-408f723701526926a2eba3435a079f0a91b0df66.tar.xz
mpd-408f723701526926a2eba3435a079f0a91b0df66.zip
decoder/vorbis: faster tag scanning with ov_test_callback()
using ov_test_callback with function CALLBACKS_STREAMONLY will cause scanning to stop after the comment field. ov_open (and ov_test) default to CALLBACKS_DEFAULT which scans the file structure causing a huge slowdown. The speed improvement is huge: It scanned my files around 10x faster This procedure has been recommended by monthy (main vorbis developer) and was said to be safe for scanning files.
-rw-r--r--NEWS2
-rw-r--r--src/decoder/vorbis_plugin.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index dbf780524..ac31684b0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
ver 0.15.3 (2009/??/??)
+* decoders:
+ - vorbis: faster tag scanning with ov_test_callback()
* output:
- fix stuttering due to uninitialized variable
* update: don't re-read unchanged container files
diff --git a/src/decoder/vorbis_plugin.c b/src/decoder/vorbis_plugin.c
index d4f81e91f..81950eb22 100644
--- a/src/decoder/vorbis_plugin.c
+++ b/src/decoder/vorbis_plugin.c
@@ -383,7 +383,7 @@ vorbis_tag_dup(const char *file)
return NULL;
}
- if (ov_open(fp, &vf, NULL, 0) < 0) {
+ if (ov_test_callbacks(fp, &vf, NULL, 0, OV_CALLBACKS_STREAMONLY) < 0) {
fclose(fp);
return NULL;
}