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.
This commit is contained in:
Rasmus Steinke 2009-08-24 22:14:22 +02:00 committed by Max Kellermann
parent 9d42f4e0ed
commit 408f723701
2 changed files with 3 additions and 1 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.15.3 (2009/??/??) ver 0.15.3 (2009/??/??)
* decoders:
- vorbis: faster tag scanning with ov_test_callback()
* output: * output:
- fix stuttering due to uninitialized variable - fix stuttering due to uninitialized variable
* update: don't re-read unchanged container files * update: don't re-read unchanged container files

View File

@ -383,7 +383,7 @@ vorbis_tag_dup(const char *file)
return NULL; return NULL;
} }
if (ov_open(fp, &vf, NULL, 0) < 0) { if (ov_test_callbacks(fp, &vf, NULL, 0, OV_CALLBACKS_STREAMONLY) < 0) {
fclose(fp); fclose(fp);
return NULL; return NULL;
} }