/*
- * Copyright (C) 2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2009-2014 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
static void read_asf_tags(const char *buf, int buf_size, struct taginfo *ti)
{
const char *p, *end = buf + buf_size, *q;
- uint16_t len1, len2, len3, len4, len5;
+ uint16_t len1, len2, len3, len4;
p = search_pattern(comment_header, sizeof(comment_header),
buf, buf_size);
p += 2;
len4 = read_u16(p);
p += 2;
- len5 = read_u16(p);
+ /* ignore length of the rating information */
p += 2;
if (p + len1 >= end)
goto next;
if (p + len2 >= end)
goto next;
ti->artist = get_str16(p, len2);
- p += len2 + len3 + len4;
- if (p + len5 >= end)
+ p += len2 + len3;
+ if (p + len4 >= end)
goto next;
- ti->comment = get_str16(p, len5);
+ ti->comment = get_str16(p, len4);
next:
p = search_pattern(extended_content_header, sizeof(extended_content_header),
buf, buf_size);
struct afh_info *afhi)
{
const uint8_t *f, *start = (uint8_t *)buf;
- int i, j, frames_per_chunk;
+ int j, frames_per_chunk;
size_t ct_size = 250;
int ret, count = 0, num_frames, num_superframes;
goto fail;
afhi->seconds_total = num_frames * 2048 /* FIXME */
/ afhi->frequency;
- frames_per_chunk = num_frames / num_superframes;
+ frames_per_chunk = num_frames / num_superframes / 2;
PARA_INFO_LOG("%d frames per chunk\n", frames_per_chunk);
- i = 0;
j = 1;
FOR_EACH_FRAME(f, start, buf_size, block_align) {
count += f[WMA_FRAME_SKIP] & 0x0f;
afhi->frequency = ahi.sample_rate;
afhi->channels = ahi.channels;
afhi->header_len = ahi.header_len;
- afhi->header_offset = 0;
wma_make_chunk_table(map + ahi.header_len, numbytes - ahi.header_len,
ahi.block_align, afhi);
read_asf_tags(map, ahi.header_len, &afhi->tags);