# HG changeset patch # User chainsaw # Date 1144022891 25200 # Node ID 8513cbe2ba3354ce582a106315e0a81bfd1a6e37 # Parent a540829b188a5ae3fd2f75282ad81ff9c56e52b6 [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. diff -r a540829b188a -r 8513cbe2ba33 Plugins/Input/aac/src/libmp4.c --- 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; }