Mercurial > audlegacy
changeset 911:8513cbe2ba33 trunk
[svn] Use a single 8-byte read instead of two 4-byte ones. The common path would nearly always result in two reads, so this should be faster.
author | chainsaw |
---|---|
date | Sun, 02 Apr 2006 17:08:11 -0700 |
parents | a540829b188a |
children | 1dd2afe391ec |
files | Plugins/Input/aac/src/libmp4.c |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugins/Input/aac/src/libmp4.c Sun Apr 02 11:32:31 2006 -0700 +++ b/Plugins/Input/aac/src/libmp4.c Sun Apr 02 17:08:11 2006 -0700 @@ -187,11 +187,11 @@ { VFSFile *file; gchar* extension; - gchar magic[4]; + gchar magic[8]; extension = strrchr(filename, '.'); if ((file = vfs_fopen(filename, "rb"))) { - vfs_fread(magic, 1, 4, file); + vfs_fread(magic, 1, 8, file); if (!memcmp(magic, AAC_MAGIC, 4)) { vfs_fclose(file); return 1; @@ -207,8 +207,7 @@ else return 0; } - vfs_fread(magic, 1, 4, file); - if (!memcmp(magic, "ftyp", 4)) { + if (!memcmp(&magic[4], "ftyp", 4)) { vfs_fclose(file); return 1; }