X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=aac_afh.c;h=bcd2a14edfd8de64baaca165f17ae855490e8cc9;hb=032d743d782e23604daa926c8e153ad4a75797be;hp=04d74e8ed91ce1c54d67f675d301c8a139c2f6c3;hpb=73073e4f4209c874f2f41e270376a9802862df8f;p=paraslash.git diff --git a/aac_afh.c b/aac_afh.c index 04d74e8e..bcd2a14e 100644 --- a/aac_afh.c +++ b/aac_afh.c @@ -33,11 +33,11 @@ static int aac_find_stsz(unsigned char *buf, size_t buflen, off_t *skip) PARA_DEBUG_LOG("found stsz@%d\n", i); i += 8; sample_size = aac_read_int32(buf + i); - PARA_DEBUG_LOG("sample size: %d\n", sample_size); + PARA_DEBUG_LOG("sample size: %u\n", sample_size); i += 4; sample_count = aac_read_int32(buf + i); i += 4; - PARA_DEBUG_LOG("sample count: %d\n", sample_count); + PARA_DEBUG_LOG("sample count: %u\n", sample_count); *skip = i; return sample_count; } @@ -46,23 +46,13 @@ static int aac_find_stsz(unsigned char *buf, size_t buflen, off_t *skip) static int atom_cmp(const unsigned char *buf1, const char *buf2) { - const unsigned char *b2 = (unsigned char *)buf2; - - if (buf1[0] != b2[0]) - return 1; - if (buf1[1] != b2[1]) - return 1; - if (buf1[2] != b2[2]) - return 1; - if (buf1[3] != b2[3]) - return 1; - return 0; + return memcmp(buf1, buf2, 4)? 1 : 0; } static int read_atom_header(unsigned char *buf, uint64_t *subsize, unsigned char type[5]) { int i; - uint64_t size = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3]; + uint64_t size = aac_read_int32(buf); memcpy(type, buf + 4, 4); type[4] = '\0'; @@ -327,7 +317,7 @@ close: return ret; } -static const char* aac_suffixes[] = {"m4a", "mp4", NULL}; +static const char * const aac_suffixes[] = {"m4a", "mp4", NULL}; /** * the init function of the aac audio format handler *