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:
parent
9d42f4e0ed
commit
408f723701
2
NEWS
2
NEWS
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue