Commit 408f7237 authored by Rasmus Steinke's avatar Rasmus Steinke Committed by Max Kellermann

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.
parent 9d42f4e0
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
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment